window.__require = function e(t, n, r) {
  function s(o, u) {
    if (!n[o]) {
      if (!t[o]) {
        var b = o.split("/");
        b = b[b.length - 1];
        if (!t[b]) {
          var a = "function" == typeof __require && __require;
          if (!u && a) return a(b, !0);
          if (i) return i(b, !0);
          throw new Error("Cannot find module '" + o + "'");
        }
        o = b;
      }
      var f = n[o] = {
        exports: {}
      };
      t[o][0].call(f.exports, function(e) {
        var n = t[o][1][e];
        return s(n || e);
      }, f, f.exports, e, t, n, r);
    }
    return n[o].exports;
  }
  var i = "function" == typeof __require && __require;
  for (var o = 0; o < r.length; o++) s(r[o]);
  return s;
}({
  AccountModel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "548cc5uzDdMRojsyhsZT44X", "AccountModel");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewModel_1 = require("../../main/modelView/ViewModel");
    var DataUtil_1 = require("../../main/utils/DataUtil");
    var ScheduleMng_1 = require("../../manager/ScheduleMng");
    var IDataModel_1 = require("../IDataModel");
    var TcbMng_1 = require("../../manager/TcbMng");
    var KEY_ACCOUNT = "account";
    var AccountModel = function(_super) {
      __extends(AccountModel, _super);
      function AccountModel() {
        var _this = _super.call(this, "account") || this;
        _this.saveNum = 0;
        return _this;
      }
      AccountModel.prototype.Init = function() {
        var defaultData = new AccountLocalData();
        this.InitData(defaultData);
        this.VMData = {
          localData: this.getAllData(),
          exData: new AccountExData(this.getAllData())
        };
        this.InitAccountExData();
        this.AddVm();
      };
      AccountModel.prototype.AddVm = function() {
        ViewModel_1.VM.add(this.VMData, "AccountModel");
      };
      AccountModel.prototype.RevVm = function() {
        ViewModel_1.VM.remove("AccountModel");
      };
      AccountModel.prototype.InitAccountExData = function() {
        this.VMData.exData.initExData();
      };
      AccountModel.prototype.Save = function() {
        var copyData = DataUtil_1.default.deepCopy(this.getAllData());
        var dataNow = JSON.stringify(copyData);
        if ("{}" != dataNow && dataNow != this.lastLocalData) {
          this.lastLocalData = dataNow;
          cc.sys.localStorage.setItem("model_" + this.modelName, dataNow);
          this.onSave();
        }
        this._syncLocalDataInterval();
      };
      AccountModel.prototype.initExDataOnCfgLoad = function() {
        var _a = this.VMData, localData = _a.localData, exData = _a.exData;
        exData.initExDataOnCfgLoad();
      };
      AccountModel.prototype.start = function() {
        ScheduleMng_1.default.addSchedule("gameloop", function() {}, 1);
      };
      AccountModel.prototype.stop = function() {
        ScheduleMng_1.default.removeSchedule("gameloop");
      };
      AccountModel.prototype.onSave = function() {
        var data = {
          account: JSON.parse(cc.sys.localStorage.getItem("model_" + this.modelName))
        };
        TcbMng_1.default.uploadData(data);
      };
      AccountModel.prototype.saveAccount = function(account) {
        this.Set(KEY_ACCOUNT, account);
        this.Save();
      };
      AccountModel.prototype.getAccount = function() {
        return this.Query(KEY_ACCOUNT, "");
      };
      AccountModel.prototype.getMessageListeners = function() {
        return {};
      };
      AccountModel.prototype.isNewPlayer = function() {
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
          var opneid = this.Query("opneid");
          return !opneid;
        }
        return 0 == this.getLocalData().maxDistance;
      };
      AccountModel.prototype.getLocalData = function() {
        var data = this.VMData.localData;
        return data;
      };
      AccountModel.prototype.getExData = function() {
        var data = this.VMData.exData;
        return data;
      };
      return AccountModel;
    }(IDataModel_1.default);
    exports.default = AccountModel;
    var AccountLocalData = function() {
      function AccountLocalData() {
        this.maxDistance = 0;
        this.playerInfo = {
          name: "",
          sex: "\u7537",
          idCard: "",
          phone: "",
          address: ""
        };
      }
      AccountLocalData.prototype.testFunction = function() {};
      return AccountLocalData;
    }();
    exports.AccountLocalData = AccountLocalData;
    var AccountExData = function() {
      function AccountExData() {
        this.distance = 0;
        this.scrollSpeed = 0;
      }
      AccountExData.prototype.initExData = function() {};
      AccountExData.prototype.initExDataOnCfgLoad = function() {};
      return AccountExData;
    }();
    exports.AccountExData = AccountExData;
    cc._RF.pop();
  }, {
    "../../main/modelView/ViewModel": "ViewModel",
    "../../main/utils/DataUtil": "DataUtil",
    "../../manager/ScheduleMng": "ScheduleMng",
    "../../manager/TcbMng": "TcbMng",
    "../IDataModel": "IDataModel"
  } ],
  Actor: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "69432KqQAJPQrkM3C8R1Myi", "Actor");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var AnimSprite_1 = require("./AnimSprite");
    var GameMng_1 = require("./GameMng");
    var OImageIds_1 = require("./OImageIds");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var Actor = function(_super) {
      __extends(Actor, _super);
      function Actor() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.incY = 0;
        _this.groundY = 0;
        _this.leftSteer = 0;
        _this.rightSteer = 0;
        _this.allowRight = true;
        _this.allowLeft = true;
        _this.actionState = "running";
        _this.overGap = false;
        _this.rotInc = 0;
        _this.blockX = 0;
        _this.powerUpState = null;
        _this.powerUpTimer = 0;
        _this.flickerInc = 0;
        _this.flickerState = false;
        _this.oBranchElementsImgData = null;
        _this.x = 0;
        _this.y = _this.groundY - 200;
        _this.alpha = 1;
        _this.animations = null;
        return _this;
      }
      Actor.prototype.onLoad = function() {
        GameMng_1.default.squirrel = this;
        this.oAnims = OImageIds_1.actorAnimaData.oAnims;
      };
      Actor.prototype.init = function() {
        this.incY = 0;
        this.groundY = 0;
        this.leftSteer = 0;
        this.rightSteer = 0;
        this.allowRight = true;
        this.allowLeft = true;
        this.actionState = "running";
        this.overGap = false;
        this.rotInc = 0;
        this.blockX = 0;
        this.powerUpState = null;
        this.powerUpTimer = 0;
        this.flickerInc = 0;
        this.flickerState = false;
        this.x = 0;
        this.y = this.groundY - 200;
        this.alpha = 1;
        if (this.turnTween) {
          this.turnTween.kill();
          this.turnTween = null;
        }
        this.x = cc.Canvas.instance.node.width / 2;
        this.animId = "running";
        this._changeAni(RoleAniType.ROLE_NORMAL);
      };
      Actor.prototype.jump = function() {
        var _this = this;
        if (0 == this.incY) {
          this.incY = -15;
          this.setAnimType("once", "jumping");
          this._changeAni(RoleAniType.ROLE_JUMP);
          this.animEndedFunc = function() {
            _this.setAnimType("loop", "falling");
            _this._changeAni(RoleAniType.ROLE_NORMAL);
          };
          this.actionState = "jumping";
        }
      };
      Actor.prototype.turn = function(G) {
        if ("left" == G && this.allowLeft) {
          this.leftSteer = 1;
          this.rightSteer = 0;
          "running" == this.actionState && addParticle("dust", this.x, 625);
          this.allowLeft = false;
          this.turnTween && this.turnTween.kill();
          this.turnTween = TweenMax.to(this, .66 - GameMng_1.default.branch.scrollSpeed / 5e3, {
            rightSteer: 0,
            leftSteer: 0,
            ease: "Cubic.easeOut",
            delay: .46 - GameMng_1.default.branch.scrollSpeed / 5e3
          });
        } else if ("right" == G && this.allowRight) {
          this.leftSteer = 0;
          this.rightSteer = -1;
          "running" == this.actionState && addParticle("dust", this.x, 625);
          this.allowRight = false;
          this.turnTween && this.turnTween.kill();
          this.turnTween = TweenMax.to(this, .66 - GameMng_1.default.branch.scrollSpeed / 5e3, {
            rightSteer: 0,
            leftSteer: 0,
            ease: "Cubic.easeOut",
            delay: .42 - GameMng_1.default.branch.scrollSpeed / 7e3
          });
        }
      };
      Actor.prototype.duck = function() {
        var _this = this;
        if (0 == this.incY && "ducking" != this.animId) {
          this.setAnimType("once", "ducking");
          this._changeAni(RoleAniType.ROLE_SQUAT);
          this.animEndedFunc = function() {
            _this.actionState = "running";
            _this.setAnimType("loop", "running");
            _this._changeAni(RoleAniType.ROLE_NORMAL);
          };
          this.actionState = "ducking";
        }
      };
      Actor.prototype.checkHit = function(G) {
        return G == this.leftSteer + this.rightSteer || GameMng_1.default.branch.aBranches.length >= 3 && G == Math.round((GameMng_1.default.branch.aBranches[2].xPos - this.x) / 120);
      };
      Actor.prototype.fallOff = function() {
        this.actionState = "falling";
        this.setAnimType("loop", "falling");
        this.incY = Math.max(this.incY, 20);
      };
      Actor.prototype.hitBlock = function() {
        this.actionState = "blocked";
        this.setAnimType("loop", "blocked");
      };
      Actor.prototype.update2 = function(delta) {
        _super.prototype.updateAnimation.call(this, delta);
        if (null != this.powerUpState) {
          this.powerUpTimer -= delta;
          this.powerUpTimer < 0 && (this.powerUpState = null);
        }
        this.fps = GameMng_1.default.branch.scrollSpeed / 32;
        this.y += this.incY;
        if ("blocked" != this.actionState) {
          GameMng_1.default.branch.aBranches.length > 3 && (this.x += 5 * (GameMng_1.default.branch.aBranches[2].xPos - 120 * (this.leftSteer + this.rightSteer) - this.x) * delta);
          this.rotation = -(this.leftSteer + this.rightSteer) / 8;
        } else this.rotation = 0;
        if (this.y >= this.groundY && "falling" != this.actionState && "blocked" != this.actionState) {
          this.incY = 0;
          this.y = this.groundY;
          if ("jumping" == this.animId || "falling" == this.animId) {
            this.setAnimType("loop", "running");
            this._changeAni(RoleAniType.ROLE_NORMAL);
            this.actionState = "running";
            addParticle("dust", this.x, 625);
          }
        } else this.incY += (20 + GameMng_1.default.branch.scrollSpeed / 40) * delta;
        this.y == this.groundY && this.overGap && "falling" != this.actionState && GameMng_1.default.endGameEvent("fall");
      };
      Actor.prototype.render = function(delta) {
        "blocked" != this.actionState && "falling" != this.actionState && GameMng_1.default.branch.aBranches[2] && 1 != GameMng_1.default.branch.aBranches[0].gapState && 1 != GameMng_1.default.branch.aBranches[1].gapState && 1 != GameMng_1.default.branch.aBranches[2].gapState;
        if (this.scaleX < 4) {
          if ("invincible" == this.powerUpState) {
            this.flickerInc -= delta;
            if (this.flickerInc < 0) {
              this.flickerState = !this.flickerState;
              this.flickerInc = .1;
            }
            this.flickerState ? this.powerUpTimer > 2 ? this.alpha = .6 : this.alpha = 1 : this.alpha = .3;
          } else this.alpha = 1;
          _super.prototype.render.call(this, delta);
          this.node.setPosition(this.x, -this.y);
          this.node.angle = this.rotation;
          this.node.opacity = 255 * this.alpha;
        }
      };
      Actor.prototype._changeAni = function(aniType) {
        var aniName = "normal";
        switch (aniType) {
         case RoleAniType.ROLE_JUMP:
          aniName = "jump";
          break;

         case RoleAniType.ROLE_SQUAT:
          aniName = "squat";
        }
        this.animations.play(aniName);
      };
      __decorate([ property(cc.Animation) ], Actor.prototype, "animations", void 0);
      Actor = __decorate([ ccclass ], Actor);
      return Actor;
    }(AnimSprite_1.AnimSprite);
    exports.Actor = Actor;
    var RoleAniType;
    (function(RoleAniType) {
      RoleAniType[RoleAniType["ROLE_NORMAL"] = 0] = "ROLE_NORMAL";
      RoleAniType[RoleAniType["ROLE_JUMP"] = 1] = "ROLE_JUMP";
      RoleAniType[RoleAniType["ROLE_SQUAT"] = 2] = "ROLE_SQUAT";
    })(RoleAniType || (RoleAniType = {}));
    function addParticle(G, O, d) {}
    cc._RF.pop();
  }, {
    "./AnimSprite": "AnimSprite",
    "./GameMng": "GameMng",
    "./OImageIds": "OImageIds"
  } ],
  AnimSprite: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "700b0jQvihCoaY3MMpXnRAC", "AnimSprite");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var AnimSprite = function(_super) {
      __extends(AnimSprite, _super);
      function AnimSprite() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.x = 0;
        _this.y = 0;
        _this.rotation = 0;
        _this.radius = 10;
        _this.removeMe = false;
        _this.frameInc = 0;
        _this.animType = "loop";
        _this.offsetX = 0;
        _this.offsetY = 0;
        _this.scaleX = 1;
        _this.scaleY = 1;
        _this.alpha = 1;
        _this.oImgData = null;
        _this.oAnims = null;
        _this.fps = 0;
        _this.animId = "";
        _this.centreX = 0;
        _this.centreY = 0;
        _this.fixedFrame = 0;
        _this.curFrame = 0;
        _this.maxIdx = 0;
        return _this;
      }
      AnimSprite.prototype.init = function(G, O, d, t) {
        this.oImgData = G;
        this.fps = O;
        this.radius = d;
        this.animId = t;
        this.oAnims = this.oImgData.oData.oAnims;
        this.centreX = Math.round(this.oImgData.oData.spriteWidth / 2);
        this.centreY = Math.round(this.oImgData.oData.spriteHeight / 2);
      };
      AnimSprite.prototype.updateAnimation = function(G) {
        this.frameInc += this.fps * G;
      };
      AnimSprite.prototype.changeImgData = function(G, O) {
        this.oImgData = G;
        this.oAnims = this.oImgData.oData.oAnims;
        this.animId = O;
        this.centreX = Math.round(this.oImgData.oData.spriteWidth / 2);
        this.centreY = Math.round(this.oImgData.oData.spriteHeight / 2);
        this.resetAnim();
      };
      AnimSprite.prototype.resetAnim = function() {
        this.frameInc = 0;
      };
      AnimSprite.prototype.setFrame = function(G) {
        this.fixedFrame = G;
      };
      AnimSprite.prototype.setAnimType = function(G, O, d) {
        "undefined" === typeof d && (d = true);
        this.animId = O;
        this.animType = G;
        d && this.resetAnim();
        switch (G) {
         case "loop":
          break;

         case "once":
          this.maxIdx = this.oAnims[this.animId].length - 1;
        }
      };
      AnimSprite.prototype.render = function(delta) {
        if (null != this.animId) {
          var O = this.oAnims[this.animId].length, d = Math.floor(this.frameInc);
          this.curFrame = this.oAnims[this.animId][d % O];
          if ("once" == this.animType && d > this.maxIdx) {
            this.fixedFrame = this.oAnims[this.animId][O - 1];
            this.animId = null;
            null != this.animEndedFunc && this.animEndedFunc();
          }
        }
      };
      AnimSprite.prototype.renderSimple = function(G) {};
      return AnimSprite;
    }(cc.Component);
    exports.AnimSprite = AnimSprite;
    cc._RF.pop();
  }, {} ],
  AudioMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "3a802W6UP9I+blLBD+JaTjk", "AudioMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ConstValue_1 = require("../const/ConstValue");
    var GameDataCenter_1 = require("../../data/GameDataCenter");
    var ResourceLoader_1 = require("../main/resource/ResourceLoader");
    var AudioMng = function() {
      function AudioMng() {
        this.bgm = "";
        cc.log("\u97f3\u6548\u5b9e\u4f8b\u6700\u5927\u8bbe\u5b9a\uff1a", 10);
        cc.audioEngine.setMaxAudioInstance(10);
      }
      AudioMng.prototype.playSound = function(soundName, loop, volume) {
        if (!GameDataCenter_1.default.system.is_open_sound) return;
        var path = ConstValue_1.ConstValue.AUDIO_DIR + soundName;
        ResourceLoader_1.default.getInstance().loadRes(path, cc.AudioClip, function(err, clip) {
          if (err) {
            cc.error(err);
            return;
          }
          var audioID = cc.audioEngine.playEffect(clip, loop || false);
        });
      };
      AudioMng.prototype.stopAll = function() {
        cc.audioEngine.stopAll();
      };
      AudioMng.prototype.pauseAll = function() {
        cc.audioEngine.pauseAll();
      };
      AudioMng.prototype.resumeAll = function() {
        cc.audioEngine.resumeAll();
      };
      AudioMng.prototype.playBGM = function(soundName) {
        if (this.bgm == soundName) return;
        this.bgm = soundName;
        if (!GameDataCenter_1.default.system.is_open_music) return;
        cc.audioEngine.stopMusic();
        var path = ConstValue_1.ConstValue.AUDIO_DIR + soundName;
        ResourceLoader_1.default.getInstance().loadRes(path, cc.AudioClip, function(err, clip) {
          if (err) {
            cc.error(err);
            return;
          }
          cc.audioEngine.playMusic(clip, true);
          cc.audioEngine.setMusicVolume(.5);
        });
      };
      AudioMng.prototype.resumeBGM = function() {
        cc.audioEngine.stopMusic();
        var path = ConstValue_1.ConstValue.AUDIO_DIR + this.bgm;
        ResourceLoader_1.default.getInstance().loadRes(path, cc.AudioClip, function(err, clip) {
          if (err) {
            cc.error(err);
            return;
          }
          cc.audioEngine.playMusic(clip, true);
        });
      };
      AudioMng.prototype.stopBGM = function() {
        cc.audioEngine.stopMusic();
      };
      return AudioMng;
    }();
    exports.default = new AudioMng();
    cc._RF.pop();
  }, {
    "../../data/GameDataCenter": "GameDataCenter",
    "../const/ConstValue": "ConstValue",
    "../main/resource/ResourceLoader": "ResourceLoader"
  } ],
  AutoLoaderCom: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d5bd9a2c+VAhqJcNF2kn6fi", "AutoLoaderCom");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ResourceLoader_1 = require("./ResourceLoader");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu;
    var AutoLoaderCom = function(_super) {
      __extends(AutoLoaderCom, _super);
      function AutoLoaderCom() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this._autoRes = [];
        return _this;
      }
      AutoLoaderCom.prototype.onLoad = function() {};
      AutoLoaderCom.prototype.onDestroy = function() {
        this.releaseAutoRes();
      };
      AutoLoaderCom.prototype.onDisable = function() {};
      AutoLoaderCom.prototype.createUseKey = function() {
        var parentName = this.node.name;
        return "NODE_USE_KEY_" + parentName + "_" + ++ResourceLoader_1.default.ResourceIndex;
      };
      AutoLoaderCom.prototype.loadRes = function(url, type, onCompleted) {
        var _this = this;
        var useStr = this.createUseKey();
        ResourceLoader_1.default.getInstance().loadRes(url, type, function(error, res) {
          error || _this._autoRes.push({
            url: url,
            type: type,
            use: useStr
          });
          onCompleted && onCompleted(error, res);
        }, useStr);
      };
      AutoLoaderCom.prototype.releaseAutoRes = function() {
        for (var index = 0; index < this._autoRes.length; index++) {
          var element = this._autoRes[index];
          ResourceLoader_1.default.getInstance().releaseRes(element.url, element.type, element.use);
        }
      };
      AutoLoaderCom = __decorate([ ccclass ], AutoLoaderCom);
      return AutoLoaderCom;
    }(cc.Component);
    exports.default = AutoLoaderCom;
    cc._RF.pop();
  }, {
    "./ResourceLoader": "ResourceLoader"
  } ],
  BackgroundAdapter: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "c9395A23IBAn5BEQV28rsN+", "BackgroundAdapter");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var BackgroundAdapter = function(_super) {
      __extends(BackgroundAdapter, _super);
      function BackgroundAdapter() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      BackgroundAdapter.prototype.onLoad = function() {
        var srcScaleForShowAll = Math.min((cc.view.getCanvasSize().width - 10) / this.node.width, (cc.view.getCanvasSize().height - 10) / this.node.height);
        var realWidth = this.node.width * srcScaleForShowAll;
        var realHeight = this.node.height * srcScaleForShowAll;
        this.node.scale = Math.max(cc.view.getCanvasSize().width / realWidth, cc.view.getCanvasSize().height / realHeight);
      };
      BackgroundAdapter = __decorate([ ccclass, menu("Adapter/BackgroundAdapter") ], BackgroundAdapter);
      return BackgroundAdapter;
    }(cc.Component);
    exports.default = BackgroundAdapter;
    cc._RF.pop();
  }, {} ],
  Background: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d10afbDr3JLiZ8Dz7aLX2Hf", "Background");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var GameMng_1 = require("./GameMng");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var Background = function(_super) {
      __extends(Background, _super);
      function Background() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      Background.prototype.onLoad = function() {
        GameMng_1.default.background = this;
      };
      Background.prototype.init = function(G, O, d) {
        this.x = 0;
        this.y = 0;
        this.incY = 0;
        this.renderState = null;
        this.targX = 0;
        this.targY = 0;
        this.projectX = 0;
        this.projectY = 0;
        this.oImgData = G;
        this.canvasWidth = O;
        this.canvasHeight = d;
        this.x = this.projectX = this.targX;
        this.y = this.projectY = this.targY;
      };
      Background.prototype.update = function(delta) {
        switch (this.renderState) {
         case "menuScroll":
          this.incY += 5 * delta;
          this.x = this.x - 100 * Math.sin(this.incY / 10) * delta;
          this.y = this.y - 200 * delta;
          break;

         case "game":
          if (!GameMng_1.default.endGameSequence && GameMng_1.default.branch.aBranches[0]) {
            GameMng_1.default.branch.aBranches[0].startSkewFrame < 30 && (this.targX += 25 * (GameMng_1.default.branch.aBranches[0].startSkewFrame - GameMng_1.default.branch.skewMidFrame) * delta);
            this.targY -= 1e3 * (GameMng_1.default.branch.aBranches[0].startHeightFactor - .25) * delta;
          }
          this.x += 5 * (this.targX - this.x) * delta;
          this.y += 5 * (this.targY - this.y) * delta;
        }
      };
      Background.prototype.render = function() {
        switch (this.renderState) {
         case "menuScroll":
         case "game":
          this.projectX = this.x % this.oImgData.img.width / 2;
          this.projectY = this.y % this.oImgData.img.height / 2;
          this.projectX < 0 && (this.projectX += this.oImgData.img.width / 2);
          this.projectY < 0 && (this.projectY += this.oImgData.img.height / 2);
        }
      };
      Background = __decorate([ ccclass ], Background);
      return Background;
    }(cc.Component);
    exports.Background = Background;
    cc._RF.pop();
  }, {
    "./GameMng": "GameMng"
  } ],
  Bezier: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ce73fKxbs9E7b8nQrbCM0wl", "Bezier");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var Bezier = function() {
      function Bezier() {}
      Bezier.getPoint = function(cps, t) {
        var ax, bx, cx;
        var ay, by, cy;
        var tSquared, tCubed;
        var result = [ 0, 0 ];
        cx = 3 * (cps[1][0] - cps[0][0]);
        bx = 3 * (cps[2][0] - cps[1][0]) - cx;
        ax = cps[3][0] - cps[0][0] - cx - bx;
        cy = 3 * (cps[1][1] - cps[0][1]);
        by = 3 * (cps[2][1] - cps[1][1]) - cy;
        ay = cps[3][1] - cps[0][1] - cy - by;
        tSquared = t * t;
        tCubed = tSquared * t;
        result[0] = ax * tCubed + bx * tSquared + cx * t + cps[0][0];
        result[1] = ay * tCubed + by * tSquared + cy * t + cps[0][1];
        return result;
      };
      return Bezier;
    }();
    exports.default = Bezier;
    cc._RF.pop();
  }, {} ],
  BhvButtonGroup: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "84b3bQST6RBTKF5mE2oheZy", "BhvButtonGroup");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu;
    var PARAM_TYPE;
    (function(PARAM_TYPE) {
      PARAM_TYPE[PARAM_TYPE["CHILDREN_INDEX"] = 0] = "CHILDREN_INDEX";
      PARAM_TYPE[PARAM_TYPE["CHILDREN_NAME"] = 1] = "CHILDREN_NAME";
    })(PARAM_TYPE || (PARAM_TYPE = {}));
    var BhvButtonGroup = function(_super) {
      __extends(BhvButtonGroup, _super);
      function BhvButtonGroup() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.transition = cc.Button.Transition.NONE;
        _this.hoverColor = cc.color(255, 255, 255);
        _this.normalColor = cc.color(214, 214, 214);
        _this.pressedColor = cc.color(211, 211, 211);
        _this.disabledColor = cc.color(124, 124, 124);
        _this.normalSprite = null;
        _this.pressedSprite = null;
        _this.hoverSprite = null;
        _this.disabledSprite = null;
        _this.duration = 1;
        _this.zoomScale = 1.1;
        _this.paramType = PARAM_TYPE.CHILDREN_INDEX;
        _this.touchEvents = [];
        return _this;
      }
      BhvButtonGroup.prototype.onLoad = function() {
        var _this = this;
        this.node.children.forEach(function(node, nodeIndex) {
          var comp = node.getComponent(cc.Button);
          comp || (comp = node.addComponent(cc.Button));
          comp.target = node;
          comp.transition = _this.transition;
          comp.zoomScale = _this.zoomScale;
          comp.disabledSprite = _this.disabledSprite;
          comp.hoverSprite = _this.hoverSprite;
          comp.normalSprite = _this.normalSprite;
          comp.pressedSprite = _this.pressedSprite;
          comp.hoverColor = _this.hoverColor;
          comp.normalColor = _this.normalColor;
          comp.pressedColor = _this.pressedColor;
          comp.disabledColor = _this.disabledColor;
          _this.touchEvents.forEach(function(event) {
            var hd = new cc.Component.EventHandler();
            hd.target = event.target;
            hd.handler = event.handler;
            hd.component = event.component;
            hd["_componentId"] = event["_componentId"];
            _this.paramType === PARAM_TYPE.CHILDREN_INDEX ? hd.customEventData = nodeIndex.toString() : hd.customEventData = node.name;
            comp.clickEvents.push(hd);
          });
        });
      };
      __decorate([ property({
        type: cc.Enum(cc.Button.Transition)
      }) ], BhvButtonGroup.prototype, "transition", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.COLOR;
        }
      }) ], BhvButtonGroup.prototype, "hoverColor", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.COLOR;
        }
      }) ], BhvButtonGroup.prototype, "normalColor", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.COLOR;
        }
      }) ], BhvButtonGroup.prototype, "pressedColor", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.COLOR;
        }
      }) ], BhvButtonGroup.prototype, "disabledColor", void 0);
      __decorate([ property({
        type: cc.SpriteFrame,
        visible: function() {
          return this.transition === cc.Button.Transition.SPRITE;
        }
      }) ], BhvButtonGroup.prototype, "normalSprite", void 0);
      __decorate([ property({
        type: cc.SpriteFrame,
        visible: function() {
          return this.transition === cc.Button.Transition.SPRITE;
        }
      }) ], BhvButtonGroup.prototype, "pressedSprite", void 0);
      __decorate([ property({
        type: cc.SpriteFrame,
        visible: function() {
          return this.transition === cc.Button.Transition.SPRITE;
        }
      }) ], BhvButtonGroup.prototype, "hoverSprite", void 0);
      __decorate([ property({
        type: cc.SpriteFrame,
        visible: function() {
          return this.transition === cc.Button.Transition.SPRITE;
        }
      }) ], BhvButtonGroup.prototype, "disabledSprite", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.SCALE || this.transition === cc.Button.Transition.COLOR;
        }
      }) ], BhvButtonGroup.prototype, "duration", void 0);
      __decorate([ property({
        visible: function() {
          return this.transition === cc.Button.Transition.SCALE;
        }
      }) ], BhvButtonGroup.prototype, "zoomScale", void 0);
      __decorate([ property({
        type: cc.Enum(PARAM_TYPE)
      }) ], BhvButtonGroup.prototype, "paramType", void 0);
      __decorate([ property([ cc.Component.EventHandler ]) ], BhvButtonGroup.prototype, "touchEvents", void 0);
      BhvButtonGroup = __decorate([ ccclass, menu("\u6dfb\u52a0\u7279\u6b8a\u884c\u4e3a/Input/Button Group(\u4e00\u7ec4\u6309\u94ae\u63a7\u5236)") ], BhvButtonGroup);
      return BhvButtonGroup;
    }(cc.Component);
    exports.default = BhvButtonGroup;
    cc._RF.pop();
  }, {} ],
  BhvFrameIndex: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f8713kGoPlOhqPdVUZOvs9o", "BhvFrameIndex");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, requireComponent = _a.requireComponent, menu = _a.menu;
    var BhvFrameIndex = function(_super) {
      __extends(BhvFrameIndex, _super);
      function BhvFrameIndex() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.spriteFrames = [ null ];
        _this._index = 0;
        return _this;
      }
      Object.defineProperty(BhvFrameIndex.prototype, "index", {
        get: function() {
          return this._index;
        },
        set: function(value) {
          if (value < 0) return;
          this._index = value % this.spriteFrames.length;
          var sprite = this.node.getComponent(cc.Sprite);
          sprite.spriteFrame = this.spriteFrames[this._index];
        },
        enumerable: true,
        configurable: true
      });
      BhvFrameIndex.prototype.setName = function(name) {
        var index = this.spriteFrames.findIndex(function(v) {
          return v.name == name;
        });
        index < 0 && cc.error("frameIndex \u8bbe\u7f6e\u4e86\u4e0d\u5b58\u5728\u7684name:", name);
        this.index = index || 0;
      };
      BhvFrameIndex.prototype.random = function(min, max) {
        if (!this.spriteFrames) return;
        var frameMax = this.spriteFrames.length;
        (null == min || min < 0) && (min = 0);
        (null == max || max > frameMax) && (max = frameMax);
        this.index = Math.floor(Math.random() * (max - min) + min);
      };
      BhvFrameIndex.prototype.next = function() {
        this.index++;
      };
      BhvFrameIndex.prototype.previous = function() {
        this.index--;
      };
      __decorate([ property({
        type: [ cc.SpriteFrame ],
        tooltip: "sprite\u5c06\u4f1a\u7528\u5230\u5e27\u56fe\u7247"
      }) ], BhvFrameIndex.prototype, "spriteFrames", void 0);
      __decorate([ property({
        tooltip: "\u5f53\u524d\u663e\u793a\u7684\u5e27\u56fe",
        type: cc.Integer
      }) ], BhvFrameIndex.prototype, "index", null);
      __decorate([ property ], BhvFrameIndex.prototype, "_index", void 0);
      BhvFrameIndex = __decorate([ ccclass, executeInEditMode, requireComponent(cc.Sprite), menu("\u6dfb\u52a0\u7279\u6b8a\u884c\u4e3a/UI/Frame Index(\u5e27\u56fe\u6539\u53d8)") ], BhvFrameIndex);
      return BhvFrameIndex;
    }(cc.Component);
    exports.default = BhvFrameIndex;
    cc._RF.pop();
  }, {} ],
  BhvRollNumber: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "190a7p8U5tHpKW20/oWneQ6", "BhvRollNumber");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu;
    var VALUE_TYPE;
    (function(VALUE_TYPE) {
      VALUE_TYPE[VALUE_TYPE["INTEGER"] = 0] = "INTEGER";
      VALUE_TYPE[VALUE_TYPE["FIXED_2"] = 1] = "FIXED_2";
      VALUE_TYPE[VALUE_TYPE["TIMER"] = 2] = "TIMER";
      VALUE_TYPE[VALUE_TYPE["PERCENTAGE"] = 3] = "PERCENTAGE";
      VALUE_TYPE[VALUE_TYPE["KMBT_FIXED2"] = 4] = "KMBT_FIXED2";
      VALUE_TYPE[VALUE_TYPE["CUSTOMER"] = 5] = "CUSTOMER";
    })(VALUE_TYPE || (VALUE_TYPE = {}));
    var BhvRollNumber = function(_super) {
      __extends(BhvRollNumber, _super);
      function BhvRollNumber() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.value = 0;
        _this.showPlusSymbol = false;
        _this._targetValue = 100;
        _this.lerp = .1;
        _this.playAtStart = true;
        _this.runWaitTimer = 0;
        _this.valueType = VALUE_TYPE.INTEGER;
        _this._custom_callback = null;
        _this.isScrolling = false;
        _this._lastLabelText = "";
        return _this;
      }
      Object.defineProperty(BhvRollNumber.prototype, "targetValue", {
        get: function() {
          return this._targetValue;
        },
        set: function(v) {
          this._targetValue = v;
          this.scroll();
        },
        enumerable: true,
        configurable: true
      });
      BhvRollNumber.prototype.onLoad = function() {
        void 0 == this.label && (this.label = this.node.getComponent(cc.Label));
        if (this.playAtStart) {
          this.updateLabel();
          this.scroll();
        }
      };
      BhvRollNumber.prototype.scroll = function() {
        var _this = this;
        if (this.isScrolling) return;
        this.runWaitTimer > 0 ? this.scheduleOnce(function() {
          _this.isScrolling = true;
        }, this.runWaitTimer) : this.isScrolling = true;
      };
      BhvRollNumber.prototype.stop = function() {
        this.value = this.targetValue;
        this.isScrolling = false;
        this.updateLabel();
      };
      BhvRollNumber.prototype.init = function(value, target, lerp) {
        this.targetValue = target || 0;
        this.value = value || 0;
        this.lerp = lerp || .1;
      };
      BhvRollNumber.prototype.scrollTo = function(target) {
        if (null === target || void 0 === target) return;
        this.targetValue = target;
      };
      BhvRollNumber.prototype.updateLabel = function() {
        var value = this.value;
        var string = "";
        switch (this.valueType) {
         case VALUE_TYPE.INTEGER:
          string = Math.round(value) + "";
          break;

         case VALUE_TYPE.FIXED_2:
          string = value.toFixed(2);
          break;

         case VALUE_TYPE.TIMER:
          string = parseTimer(value);
          break;

         case VALUE_TYPE.PERCENTAGE:
          string = Math.round(100 * value) + "%";
          break;

         case VALUE_TYPE.KMBT_FIXED2:
          string = value >= Number.MAX_VALUE ? "MAX" : value > 1e12 ? (value / 1e12).toFixed(2) + "T" : value > 1e9 ? (value / 1e9).toFixed(2) + "B" : value > 1e6 ? (value / 1e6).toFixed(2) + "M" : value > 1e3 ? (value / 1e3).toFixed(2) + "K" : Math.round(value).toString();
          break;

         case VALUE_TYPE.CUSTOMER:
          this._custom_callback && (string = this._custom_callback(this.value, this.targetValue));
        }
        this.showPlusSymbol && (value > 0 ? string = "+" + string : value < 0 && (string = "-" + string));
        if (this.label) {
          if (string === this.label.string) return;
          this.label.string = string;
        }
      };
      BhvRollNumber.prototype.update = function(dt) {
        if (false == this.isScrolling) return;
        this.value = cc.misc.lerp(this.value, this.targetValue, this.lerp);
        this.updateLabel();
        if (Math.abs(this.value - this.targetValue) <= 1e-4) {
          this.value = this.targetValue;
          this.isScrolling = false;
          return;
        }
      };
      __decorate([ property({
        type: cc.Label,
        tooltip: "\u9700\u8981\u6eda\u52a8\u7684 Label \u7ec4\u4ef6,\u5982\u679c\u4e0d\u8fdb\u884c\u8bbe\u7f6e\uff0c\u5c31\u4f1a\u4ece\u81ea\u5df1\u7684\u8282\u70b9\u81ea\u52a8\u67e5\u627e"
      }) ], BhvRollNumber.prototype, "label", void 0);
      __decorate([ property({
        tooltip: "\u5f53\u524d\u7684\u6eda\u52a8\u503c(\u5f00\u59cb\u7684\u6eda\u52a8\u503c)"
      }) ], BhvRollNumber.prototype, "value", void 0);
      __decorate([ property({
        tooltip: "\u662f\u5426\u663e\u793a\u6b63\u8d1f\u7b26\u53f7"
      }) ], BhvRollNumber.prototype, "showPlusSymbol", void 0);
      __decorate([ property({
        tooltip: "\u6eda\u52a8\u7684\u76ee\u6807\u503c"
      }) ], BhvRollNumber.prototype, "targetValue", null);
      __decorate([ property ], BhvRollNumber.prototype, "_targetValue", void 0);
      __decorate([ property({
        tooltip: "\u6eda\u52a8\u7684\u7ebf\u6027\u5dee\u503c",
        step: .01,
        max: 1,
        min: 0
      }) ], BhvRollNumber.prototype, "lerp", void 0);
      __decorate([ property({
        tooltip: "\u662f\u5426\u5728\u5f00\u59cb\u65f6\u5c31\u64ad\u653e"
      }) ], BhvRollNumber.prototype, "playAtStart", void 0);
      __decorate([ property({
        tooltip: "\u5728\u6eda\u52a8\u4e4b\u524d\u4f1a\u7b49\u5f85\u51e0\u79d2",
        step: .1,
        max: 1,
        min: 0
      }) ], BhvRollNumber.prototype, "runWaitTimer", void 0);
      __decorate([ property({
        type: cc.Enum(VALUE_TYPE),
        tooltip: "\u662f\u5426\u5728\u5f00\u59cb\u65f6\u5c31\u64ad\u653e"
      }) ], BhvRollNumber.prototype, "valueType", void 0);
      BhvRollNumber = __decorate([ ccclass, menu("\u6dfb\u52a0\u7279\u6b8a\u884c\u4e3a/UI/Roll Number (\u6eda\u52a8\u6570\u5b57)") ], BhvRollNumber);
      return BhvRollNumber;
    }(cc.Component);
    exports.default = BhvRollNumber;
    function parseTimer(timer, isFullTimer) {
      void 0 === timer && (timer = 0);
      void 0 === isFullTimer && (isFullTimer = true);
      var t = Math.floor(timer);
      var hours = Math.floor(t / 3600);
      var mins = Math.floor(t % 3600 / 60);
      var secs = t % 60;
      var m = "" + mins;
      var s = "" + secs;
      secs < 10 && (s = "0" + secs);
      if (isFullTimer) {
        mins < 10 && (m = "0" + mins);
        return hours + ":" + m + ":" + s;
      }
      m = "" + (mins + 60 * hours);
      mins < 10 && (m = "0" + mins);
      return m + ":" + s;
    }
    cc._RF.pop();
  }, {} ],
  BigNumberUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d0272x0dH5F3JoUCMVMwAyB", "BigNumberUtil");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var BigNumber = function() {
      function BigNumber(num, unit) {
        void 0 === unit && (unit = null);
        this.num = 0;
        this.unit = 0;
        if ("number" == typeof num) this.setValue(num, unit); else {
          var a = num;
          a = num;
          this.setValue(num.num, num.unit);
        }
      }
      BigNumber.prototype.addSelf = function(num) {
        var isVaild = this.isVaild(num);
        if (isVaild) {
          this.num = isVaild.num;
          this.unit = isVaild.unit;
          return this;
        }
        var dif = this.unit - num.unit;
        if (dif >= 0) this.num = this.num + num.num * Math.pow(10, -dif); else {
          this.num = num.num + this.num * Math.pow(10, dif);
          this.unit = num.unit;
        }
        this.resetValue(this);
        return this;
      };
      BigNumber.prototype.add = function(num) {
        var isVaild = this.isVaild(num);
        if (isVaild) {
          var newNum_1 = new BigNumber(isVaild.num, isVaild.unit);
          return newNum_1;
        }
        var newNum = new BigNumber(this.num, this.unit);
        var dif = newNum.unit - num.unit;
        if (dif >= 0) newNum.num = newNum.num + num.num * Math.pow(10, -dif); else {
          newNum.num = num.num + newNum.num * Math.pow(10, dif);
          newNum.unit = num.unit;
        }
        this.resetValue(newNum);
        return newNum;
      };
      BigNumber.prototype.subSelf = function(num) {
        var isVaild = this.isVaild(num);
        if (isVaild) {
          if (this.unit > num.unit) return this;
          this.num = -num.num;
          this.unit = num.unit;
          return this;
        }
        var dif = this.unit - num.unit;
        if (dif >= 0) this.num = this.num - num.num * Math.pow(10, -dif); else {
          this.num = -(num.num - this.num * Math.pow(10, dif));
          this.unit = num.unit;
        }
        this.resetValue(this);
        return this;
      };
      BigNumber.prototype.sub = function(num) {
        var isVaild = this.isVaild(num);
        if (isVaild) {
          if (this.unit > num.unit) {
            var newNum_2 = new BigNumber(this.num, this.unit);
            return newNum_2;
          }
          isVaild.num *= -1;
          return isVaild;
        }
        var newNum = new BigNumber(this.num, this.unit);
        var dif = newNum.unit - num.unit;
        if (dif >= 0) newNum.num = newNum.num - num.num * Math.pow(10, -dif); else {
          newNum.num = -(num.num - newNum.num * Math.pow(10, dif));
          newNum.unit = num.unit;
        }
        this.resetValue(newNum);
        return newNum;
      };
      BigNumber.prototype.multSelf = function(num) {
        this.num *= num;
        this.resetValue(this);
        return this;
      };
      BigNumber.prototype.mult = function(num) {
        var newNum = new BigNumber(this.num, this.unit);
        newNum.num *= num;
        this.resetValue(newNum);
        return newNum;
      };
      BigNumber.prototype.multSelfBig = function(num) {
        this.num *= num.num;
        this.unit += num.unit;
        this.resetValue(this);
        return this;
      };
      BigNumber.prototype.multBig = function(num) {
        var newNum = new BigNumber(this.num, this.unit);
        newNum.num *= num.num;
        newNum.unit += num.unit;
        this.resetValue(newNum);
        return newNum;
      };
      BigNumber.prototype.divSelf = function(num) {
        this.num /= num;
        this.resetValue(this);
        return this;
      };
      BigNumber.prototype.div = function(num) {
        var newNum = new BigNumber(this.num, this.unit);
        newNum.num /= num;
        this.resetValue(newNum);
        return newNum;
      };
      BigNumber.prototype.getRatio = function(num) {
        if (this.unit - num.unit > 5) return 1;
        if (num.unit - this.unit > 5) return 0;
        var dif = this.unit - num.unit;
        return this.num / (num.num * Math.pow(10, -dif));
      };
      BigNumber.prototype.resetValue = function(num) {
        if (Number.isNaN(num.num) || Number.isNaN(num.unit)) {
          cc.error("\u8ba1\u7b97\u51fa\u95ee\u9898");
          return;
        }
        if (num.num >= 10) {
          num.num /= 10;
          num.unit++;
          num.resetValue(num);
        } else if (num.num < 1 && num.num > 0 && num.unit > 0) {
          num.num *= 10;
          num.unit--;
          num.resetValue(num);
        } else if (num.num > -1 && num.num < 0 && num.unit > 0) {
          num.num *= 10;
          num.unit--;
          num.resetValue(num);
        } else if (this.num < -10) {
          num.num /= 10;
          num.unit++;
          num.resetValue(num);
        } else num.num = Math.floor(1e5 * num.num) / 1e5;
      };
      BigNumber.prototype.isVaild = function(num) {
        return this.unit - num.unit > 5 ? this : num.unit - this.unit > 5 ? num : null;
      };
      BigNumber.prototype.setValue = function(num, unit) {
        this.num = num;
        this.unit = unit;
        this.resetValue(this);
      };
      return BigNumber;
    }();
    exports.default = BigNumber;
    false;
    cc._RF.pop();
  }, {} ],
  Branches: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "057600d4VhIWJgzurh5DfDF", "Branches");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var GameDataCenter_1 = require("../../../data/GameDataCenter");
    var DrawImage_1 = require("./DrawImage");
    var GameMng_1 = require("./GameMng");
    var OImageIds_1 = require("./OImageIds");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var canvas;
    var oGameData;
    var Branches = function(_super) {
      __extends(Branches, _super);
      function Branches() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.perspScaleFactor = .876;
        _this.skewOffset = 3;
        _this.entireScale = 1.8;
        _this.incY = 0;
        _this._scrollSpeed = 400;
        _this.skewMidFrame = 15;
        _this.segNum = 30;
        _this.scaletoSpeedRatio = 523;
        _this.sineInc = 0;
        _this.canChangeBehaviour = true;
        _this.canAddBranch = true;
        _this.horizontalBranchState = 0;
        _this.justTurned = false;
        _this.turnOffset = 0;
        _this.behaviourChangeInc = 0;
        _this.behaviourChangeTarg = 3;
        _this.curveChangeInc = 0;
        _this.curveChangeTarg = 2;
        _this.hillChangeInc = 0;
        _this.hillChangeTarg = 2;
        _this.curveType = 0;
        _this.hillType = 0;
        _this.heightFactorTarg = .25;
        _this.curveTarg = 15;
        _this.gapState = 0;
        _this.gapInc = 0;
        _this.nextBlockType = 0;
        _this.coinInc = 0;
        _this.fixedSegHeight = 42;
        _this.segCount = 0;
        _this.lastGemCount = 0;
        _this.powerUpCount = 30;
        _this.moveSpeed = 800;
        _this.oBranchImg = null;
        _this.oBranchImgData = null;
        _this.oBranchElementsImgData = null;
        _this.container = null;
        _this.aBranches = [];
        return _this;
      }
      Object.defineProperty(Branches.prototype, "scrollSpeed", {
        get: function() {
          return this._scrollSpeed;
        },
        set: function(value) {
          this._scrollSpeed = value;
          oGameData.scrollSpeed = this._scrollSpeed / 50;
        },
        enumerable: true,
        configurable: true
      });
      Branches.prototype.onLoad = function() {
        GameMng_1.default.branch = this;
        canvas = cc.Canvas.instance.node;
        GameMng_1.default.canvas = canvas;
        DrawImage_1.default.container = this.container;
        DrawImage_1.default.canvans = canvas;
        this.oBranchImgData = {
          oData: {
            spriteHeight: 42,
            spriteWidth: 222
          },
          img: this.oBranchImg
        };
        oGameData = GameDataCenter_1.default.account.getExData();
      };
      Branches.prototype.onEnable = function() {};
      Branches.prototype.onDestroy = function() {
        DrawImage_1.default.spritePool.clear();
      };
      Branches.prototype.init = function() {
        this.initData();
        var G = 0, O = 0, d = 1, t = 0, s = this.skewMidFrame;
        for (var A = 0; A < this.segNum; A++) if (0 == A) {
          G = canvas.width / 2;
          O = canvas.height - this.oBranchImgData.oData.spriteHeight * this.entireScale;
          this.aBranches.push({
            powerUpState: GameMng_1.default.squirrel.powerUpState,
            count: this.segCount++,
            coinOffset: 2 * Math.random() - 1,
            blockType: 0,
            gapState: this.gapState,
            startSkewFrame: s,
            skewFrame: s,
            curSkewOffset: t,
            xPos: G,
            yPos: O,
            scale: d,
            startHeightFactor: .25,
            heightFactor: .25
          });
        } else this.addSegment(false);
        TweenMax.to(this, .5, {
          scrollSpeed: this.moveSpeed + 25 * GameMng_1.default.aPowerUpBarData[0],
          ease: "Quad.easeIn"
        });
      };
      Branches.prototype.initData = function() {
        this.perspScaleFactor = .876;
        this.skewOffset = 3;
        this.entireScale = 1.8;
        this.incY = 0;
        this.scrollSpeed = 400;
        this.skewMidFrame = 15;
        this.segNum = 30;
        this.scaletoSpeedRatio = 523;
        this.sineInc = 0;
        this.canChangeBehaviour = true;
        this.canAddBranch = true;
        this.horizontalBranchState = 0;
        this.justTurned = false;
        this.turnOffset = 0;
        this.behaviourChangeInc = 0;
        this.behaviourChangeTarg = 3;
        this.curveChangeInc = 0;
        this.curveChangeTarg = 2;
        this.hillChangeInc = 0;
        this.hillChangeTarg = 2;
        this.curveType = 0;
        this.hillType = 0;
        this.heightFactorTarg = .25;
        this.curveTarg = 15;
        this.gapState = 0;
        this.gapInc = 0;
        this.nextBlockType = 0;
        this.coinInc = 0;
        this.fixedSegHeight = 42;
        this.segCount = 0;
        this.lastGemCount = 0;
        this.powerUpCount = 30;
        this.moveSpeed = 800;
        this.aBranches = [];
      };
      Branches.prototype.addSegment = function(G, O, d) {
        void 0 === G && (G = true);
        void 0 === O && (O = 0);
        void 0 === d && (d = 1);
        this.sineInc += .1;
        var t = this.aBranches[this.aBranches.length - 1].skewFrame;
        this.aBranches[this.aBranches.length - 1].startSkewFrame < 60 && (t -= Math.round((this.aBranches[this.aBranches.length - 1].startSkewFrame - this.curveTarg) / 2));
        var s = this.aBranches[this.aBranches.length - 1].startHeightFactor;
        s -= (this.aBranches[this.aBranches.length - 1].startHeightFactor - this.heightFactorTarg) / 2;
        var A = (this.aBranches[this.aBranches.length - 1].skewFrame - this.skewMidFrame) * this.skewOffset, B = this.aBranches[this.aBranches.length - 1].xPos;
        this.aBranches[0].scale = 1;
        this.aBranches[0].yPos = canvas.height - this.oBranchImgData.oData.spriteHeight * this.aBranches[0].heightFactor * this.entireScale;
        var k = this.gapState, g = t;
        if (1 == this.gapState) {
          this.gapInc--;
          if (this.aBranches[this.aBranches.length - 1].startSkewFrame < 60) {
            g = 60;
            k = 0;
          } else g = 60;
          if (this.gapInc <= 0) {
            g = 61;
            this.gapState = 0;
            k = 0;
            this.canChangeBehaviour = true;
            this.behaviourChangeTarg = 2 * Math.random() + .5;
          }
        }
        this.lastGemCount++;
        if ((this.lastGemCount > 4 || "gems" == GameMng_1.default.squirrel.powerUpState && this.lastGemCount > 2) && 0 == this.nextBlockType && 0 == this.gapInc && G && 60 != g && 61 != g && (1 * Math.random() > .85 - GameMng_1.default.aPowerUpBarData[3] / 40 || "gems" == GameMng_1.default.squirrel.powerUpState)) if (!GameMng_1.default.firstRun && --this.powerUpCount < 0) {
          this.powerUpCount = 30 - 2 * GameMng_1.default.aPowerUpBarData[2];
          this.lastGemCount = -10;
          this.nextBlockType = 11 + Math.floor(4 * Math.random());
        } else if (!GameMng_1.default.firstRun || 0 == GameMng_1.default.hud.tutState) {
          this.lastGemCount = 0;
          this.nextBlockType = 6 + Math.floor(5 * Math.random());
        }
        var w = 2 * Math.random() - 1;
        GameMng_1.default.firstRun && 0 == GameMng_1.default.hud.tutState && 0 == Math.round(w) && (w = -1);
        this.aBranches.push({
          powerUpState: GameMng_1.default.squirrel.powerUpState,
          count: this.segCount++,
          coinOffset: w,
          blockType: this.nextBlockType,
          gapState: k,
          startSkewFrame: g,
          skewFrame: t,
          curSkewOffset: A,
          xPos: B,
          yPos: 0,
          scale: 0,
          startHeightFactor: s,
          heightFactor: s
        });
        this.nextBlockType = 0;
      };
      Branches.prototype.resetBranchBase = function(G, O) {
        void 0 === G && (G = 0);
        void 0 === O && (O = 1);
        this.aBranches[0].scale = 1;
        this.aBranches[0].yPos = canvas.height - this.oBranchImgData.oData.spriteHeight * this.aBranches[0].heightFactor * this.entireScale;
      };
      Branches.prototype.addHorizontal = function() {
        this.canAddBranch = false;
        var G = -1, O = (this.aBranches[this.aBranches.length - 1].skewFrame - this.skewMidFrame) * this.skewOffset, d = this.aBranches[this.aBranches.length - 1].xPos, t = this.aBranches[this.aBranches.length - 1].startHeightFactor;
        t -= (this.aBranches[this.aBranches.length - 1].startHeightFactor - this.heightFactorTarg) / 2;
        this.aBranches[0].scale = 1;
        this.aBranches[0].yPos = canvas.height - this.oBranchImgData.oData.spriteHeight * this.aBranches[0].heightFactor * this.entireScale;
        this.aBranches.push({
          powerUpState: GameMng_1.default.squirrel.powerUpState,
          count: this.segCount++,
          coinOffset: 2 * Math.random() - 1,
          blockType: 0,
          gapState: this.gapState,
          startSkewFrame: G,
          skewFrame: G,
          curSkewOffset: O,
          xPos: d,
          yPos: 0,
          scale: 0,
          startHeightFactor: t,
          heightFactor: t
        });
      };
      Branches.prototype.triggerTurn = function(G) {
        this.horizontalBranchState = 0;
        this.canAddBranch = true;
        this.canChangeBehaviour = true;
        this.justTurned = true;
        this.behaviourChangeTarg = 2 * Math.random();
        this.aBranches = new Array();
        var O = 0, d = 0, t = 1, s = 0, A = this.skewMidFrame;
        this.heightFactorTarg = 1.5 * Math.random() - .5;
        var B = Math.round(Math.random() * (this.segNum / 2) + this.segNum / 3);
        for (var k = 0; k < this.segNum; k++) if (0 == k) {
          O = canvas.width / 2;
          d = canvas.height - this.oBranchImgData.oData.spriteHeight * this.entireScale;
          this.aBranches.push({
            powerUpState: GameMng_1.default.squirrel.powerUpState,
            count: this.segCount++,
            coinOffset: 2 * Math.random() - 1,
            blockType: 0,
            gapState: this.gapState,
            startSkewFrame: A,
            skewFrame: A,
            curSkewOffset: s,
            xPos: O,
            yPos: d,
            scale: t,
            startHeightFactor: .75,
            heightFactor: .75
          });
        } else {
          if (k == B) {
            this.changeBehaviour();
            if (this.horizontalBranchState > 0) {
              this.addHorizontal();
              break;
            }
          }
          k < this.segNum / 4 ? this.addSegment(false) : this.addSegment();
        }
        if ("right" == G) {
          this.turnOffset = 1;
          this.turnTween = TweenMax.to(this, .4, {
            turnOffset: 0,
            ease: "Cubic.easeOut"
          });
          GameMng_1.default.background.targX += 1500;
        } else {
          this.turnOffset = -1;
          this.turnTween = TweenMax.to(this, .4, {
            turnOffset: 0,
            ease: "Cubic.easeOut"
          });
          GameMng_1.default.background.targX -= 1500;
        }
      };
      Branches.prototype.changeBehaviour = function() {
        var G = Math.floor(9 * Math.random());
        GameMng_1.default.firstRun && 1 == GameMng_1.default.hud.tutState && (G = 7);
        this.lastGemCount = 0;
        switch (G) {
         case 0:
          this.horizontalBranchState = 1;
          this.canChangeBehaviour = false;
          break;

         case 1:
          this.horizontalBranchState = 2;
          this.canChangeBehaviour = false;
          break;

         case 2:
          this.horizontalBranchState = 3;
          this.canChangeBehaviour = false;
          break;

         case 3:
          this.gapState = 1;
          this.gapInc = Math.floor(5 * Math.random()) + 3;
          this.curveTarg = this.skewMidFrame;
          this.canChangeBehaviour = false;
          break;

         case 4:
          this.nextBlockType = 1;
          break;

         case 5:
          this.nextBlockType = 2;
          break;

         case 6:
          this.nextBlockType = 3;
          break;

         case 7:
          this.nextBlockType = 4;
          break;

         case 8:
          this.nextBlockType = 5;
        }
      };
      Branches.prototype.changeCurve = function() {
        this.curveTarg = Math.floor(30 * Math.random());
      };
      Branches.prototype.changeHill = function() {
        GameMng_1.default.firstRun ? this.heightFactorTarg = .75 * Math.random() - .5 : this.heightFactorTarg = 1.5 * Math.random() - .5;
      };
      Branches.prototype.update = function(delta) {
        if (this.canChangeBehaviour && (!GameMng_1.default.firstRun || 1 == GameMng_1.default.hud.tutState)) {
          this.behaviourChangeInc += delta;
          if (this.behaviourChangeInc > this.behaviourChangeTarg && this.lastGemCount > 5) {
            this.behaviourChangeInc = 0;
            this.behaviourChangeTarg = 1 * Math.random() + .7;
            this.changeBehaviour();
          }
        }
        GameMng_1.default.firstRun || (oGameData.distance = oGameData.distance + this.scrollSpeed / 100 * delta);
        this.curveChangeInc += delta;
        if (this.curveChangeInc > this.curveChangeTarg) {
          this.curveChangeInc = 0;
          this.curveChangeTarg = 3 * Math.random() + 1;
          this.changeCurve();
        }
        this.hillChangeInc += delta;
        if (this.hillChangeInc > this.hillChangeTarg) {
          this.hillChangeInc = 0;
          this.hillChangeTarg = 3 * Math.random() + 1;
          this.changeHill();
        }
        this.centreLine = 75 * (GameMng_1.default.squirrel.leftSteer + GameMng_1.default.squirrel.rightSteer) + canvas.width / 2;
        this.horizontalBranchState > 0 && 2 == this.aBranches.length ? (1 == this.horizontalBranchState || 3 == this.horizontalBranchState) && GameMng_1.default.squirrel.leftSteer + GameMng_1.default.squirrel.rightSteer < 0 ? this.triggerTurn("right") : (2 == this.horizontalBranchState || 3 == this.horizontalBranchState) && GameMng_1.default.squirrel.leftSteer + GameMng_1.default.squirrel.rightSteer > 0 && this.triggerTurn("left") : this.horizontalBranchState > 0 && this.aBranches.length <= 0 && (GameMng_1.default.squirrel.overGap = true);
        if (this.aBranches.length > 0 && this.aBranches[0].yPos > canvas.height) {
          var G = this.aBranches[0].yPos - canvas.height, O = this.aBranches[0].scale * this.perspScaleFactor;
          this.aBranches.splice(0, 1);
          this.canAddBranch ? this.horizontalBranchState > 0 ? this.addHorizontal() : this.addSegment(true, G, O) : this.aBranches.length > 0 && this.resetBranchBase(G, O);
        }
        this.render(delta);
      };
      Branches.prototype.render = function(delta) {
        DrawImage_1.default.recover(this.container);
        var G;
        for (var O = 0; O < this.aBranches.length; O++) if (this.aBranches[O].skewFrame > -1) if (0 == O) {
          this.aBranches[O].scale += this.scrollSpeed / this.scaletoSpeedRatio * delta;
          this.aBranches[O].virtualXPos = this.centreLine;
          this.aBranches[O].xPos += (this.aBranches[O].virtualXPos - this.aBranches[O].xPos) * ((this.aBranches.length - O) / 25 + .5) * delta;
          this.aBranches[O].yPos += this.scrollSpeed * this.aBranches[O].heightFactor * delta;
        } else {
          if (O < this.skewMidFrame) {
            this.aBranches[O].skewFrame < this.skewMidFrame - O ? this.aBranches[O].skewFrame += 1 : this.aBranches[O].skewFrame > this.skewMidFrame + O && (this.aBranches[O].skewFrame -= 1);
            this.aBranches[O - 1].startSkewFrame < 60 ? this.aBranches[O].curSkewOffset = (this.aBranches[O - 1].skewFrame - this.skewMidFrame) * this.skewOffset : this.aBranches[O].curSkewOffset = 0;
          }
          this.aBranches[O].scale = this.aBranches[O - 1].scale * this.perspScaleFactor;
          this.aBranches[O].heightFactor = this.aBranches[O].startHeightFactor + this.aBranches[O].scale * (1.5 - this.aBranches[O].startHeightFactor);
          this.aBranches[O].virtualXPos = this.aBranches[O - 1].virtualXPos + this.aBranches[O].curSkewOffset * this.aBranches[O - 1].scale;
          this.aBranches[O].xPos += (this.aBranches[O].virtualXPos - this.aBranches[O].xPos) * ((this.aBranches.length - O) / 15 + .5) * delta;
          this.aBranches[O].yPos = this.aBranches[O - 1].yPos - (this.oBranchImgData.oData.spriteHeight - 1) * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale;
        } else {
          var spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds["horiz" + this.horizontalBranchState]);
          var rect = spriteFrame.getRect();
          var d = rect.x, t = rect.y, s = rect.width, A = rect.height, B;
          if (0 == O) {
            this.aBranches[O].scale += this.scrollSpeed / this.scaletoSpeedRatio * delta;
            this.aBranches[O].virtualXPos = this.centreLine;
            this.aBranches[O].xPos += (this.aBranches[O].virtualXPos - this.aBranches[O].xPos) * ((this.aBranches.length - O) / 25 + .5) * delta;
            this.aBranches[O].yPos += this.scrollSpeed * delta;
          } else {
            O < this.skewMidFrame && (this.aBranches[O].curSkewOffset = (this.aBranches[O - 1].skewFrame - this.skewMidFrame) * this.skewOffset);
            this.aBranches[O].scale = this.aBranches[O - 1].scale * this.perspScaleFactor;
            this.aBranches[O].heightFactor = Math.max(this.aBranches[O].startHeightFactor + this.aBranches[O].scale * (1.5 - this.aBranches[O].startHeightFactor), .5);
            this.aBranches[O].virtualXPos = this.aBranches[O - 1].virtualXPos + this.aBranches[O].curSkewOffset * this.aBranches[O - 1].scale;
            this.aBranches[O].xPos += (this.aBranches[O].virtualXPos - this.aBranches[O].xPos) * ((this.aBranches.length - O) / 25 + .5) * delta;
            this.aBranches[O].yPos = this.aBranches[O - 1].yPos - (A - .5) * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale;
          }
        }
        for (var O = this.aBranches.length - 1; O >= 0; O--) if (this.aBranches[O].skewFrame > -1) if (0 == O) {
          G = this.aBranches[O].skewFrame;
          this.aBranches[O].startSkewFrame > 29 ? G = this.aBranches[O].startSkewFrame : Math.floor(this.aBranches[O].count / 2) % 2 == 0 && (G += 30);
          var k = G * this.oBranchImgData.oData.spriteWidth % this.oBranchImgData.img.width, g = Math.floor(G / (this.oBranchImgData.img.width / this.oBranchImgData.oData.spriteWidth)) * this.oBranchImgData.oData.spriteHeight;
          0 == this.aBranches[O].gapState && DrawImage_1.default.drawImage(this.oBranchImgData.img, k, g, this.oBranchImgData.oData.spriteWidth, this.oBranchImgData.oData.spriteHeight, this.aBranches[O].xPos - this.oBranchImgData.oData.spriteWidth / 2 * this.aBranches[O].scale * this.entireScale, this.aBranches[O].yPos, this.oBranchImgData.oData.spriteWidth * this.aBranches[O].scale * this.entireScale, this.oBranchImgData.oData.spriteHeight * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
        } else {
          G = this.aBranches[O].skewFrame;
          this.aBranches[O].startSkewFrame > 29 ? G = this.aBranches[O].startSkewFrame : this.aBranches[O].count % 2 != 0 && (G += 30);
          var k = G * this.oBranchImgData.oData.spriteWidth % this.oBranchImgData.img.width, g = Math.floor(G / (this.oBranchImgData.img.width / this.oBranchImgData.oData.spriteWidth)) * this.oBranchImgData.oData.spriteHeight;
          0 == this.aBranches[O].gapState && DrawImage_1.default.drawImage(this.oBranchImgData.img, k, g, this.oBranchImgData.oData.spriteWidth, this.oBranchImgData.oData.spriteHeight, this.aBranches[O].xPos - this.oBranchImgData.oData.spriteWidth / 2 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos, this.oBranchImgData.oData.spriteWidth * this.aBranches[O].scale * this.entireScale, Math.max(this.oBranchImgData.oData.spriteHeight * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale, 1));
        } else {
          var spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds["horiz" + this.horizontalBranchState]);
          var rect = spriteFrame.getRect();
          var d = rect.x, t = rect.y, s = rect.width, A = rect.height, B;
          if (0 == O) {
            B = s / 2;
            1 == this.horizontalBranchState ? B = this.oBranchImgData.oData.spriteWidth / 2 : 2 == this.horizontalBranchState && (B = s - this.oBranchImgData.oData.spriteWidth / 2);
            DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos - B * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
          } else {
            B = s / 2;
            1 == this.horizontalBranchState ? B = this.oBranchImgData.oData.spriteWidth / 2 : 2 == this.horizontalBranchState && (B = s - this.oBranchImgData.oData.spriteWidth / 2);
            DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos - B * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
            spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.straightHoriz);
            rect = spriteFrame.getRect();
            var d = rect.x, t = rect.y, s = rect.width, A = rect.height;
            if (1 == this.horizontalBranchState) {
              var w = this.aBranches[O].xPos + (this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.horiz1).getOriginalSize().width - this.oBranchImgData.oData.spriteWidth / 2) * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O);
              DrawImage_1.default.drawImage2(spriteFrame, w, this.aBranches[O].yPos, Math.max(canvas.width - w, s), Math.max(A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale, 1));
              spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.turnSignRight);
              rect = spriteFrame.getRect();
              var d = rect.x, t = rect.y, s = rect.width, A = rect.height;
              DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos + 20 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos - (A * this.aBranches[O].scale - this.oBranchImgData.oData.spriteHeight / 2 * this.aBranches[O].scale * this.aBranches[O].heightFactor) * this.entireScale, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.entireScale);
            } else if (2 == this.horizontalBranchState) {
              var w = this.aBranches[O].xPos - (this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.horiz2).getOriginalSize().width - this.oBranchImgData.oData.spriteWidth / 2) * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O);
              DrawImage_1.default.drawImage2(spriteFrame, w - Math.max(w, s), this.aBranches[O].yPos, Math.max(w, s), A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
              spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.turnSignLeft);
              rect = spriteFrame.getRect();
              var d = rect.x, t = rect.y, s = rect.width, A = rect.height;
              DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos + (-20 - s) * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos - (A * this.aBranches[O].scale - this.oBranchImgData.oData.spriteHeight / 2 * this.aBranches[O].scale * this.aBranches[O].heightFactor) * this.entireScale, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.entireScale);
            } else {
              var w = this.aBranches[O].xPos + this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.horiz3).getOriginalSize().width / 2 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O);
              DrawImage_1.default.drawImage2(spriteFrame, w, this.aBranches[O].yPos, Math.max(canvas.width - w, s), A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
              w = this.aBranches[O].xPos - this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.horiz3).getOriginalSize().width / 2 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O);
              DrawImage_1.default.drawImage2(spriteFrame, w - Math.max(w, s), this.aBranches[O].yPos, Math.max(w, s), A * this.aBranches[O].scale * this.aBranches[O].heightFactor * this.entireScale);
              spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds.turnSignT);
              rect = spriteFrame.getRect();
              var d = rect.x, t = rect.y, s = rect.width, A = rect.height;
              DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos - s / 2 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos - (A * this.aBranches[O].scale - this.oBranchImgData.oData.spriteHeight / 2 * this.aBranches[O].scale * this.aBranches[O].heightFactor) * this.entireScale, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.entireScale);
            }
          }
        }
        for (var O = this.aBranches.length - 1; O >= 0; O--) {
          (0 == O || 1 == O) && this.aBranches.length > 2 && (1 == this.aBranches[O].gapState ? GameMng_1.default.squirrel.overGap = true : GameMng_1.default.squirrel.overGap = false);
          if (0 == O && this.aBranches[O].blockType > 0 && "invincible" != GameMng_1.default.squirrel.powerUpState) switch (this.aBranches[O].blockType) {
           case 1:
            (GameMng_1.default.squirrel.checkHit(-1) || GameMng_1.default.squirrel.checkHit(0)) && "blocked" != GameMng_1.default.squirrel.actionState && GameMng_1.default.endGameEvent("block");
            break;

           case 2:
            (GameMng_1.default.squirrel.checkHit(1) || GameMng_1.default.squirrel.checkHit(0)) && "blocked" != GameMng_1.default.squirrel.actionState && GameMng_1.default.endGameEvent("block");
            break;

           case 3:
            "ducking" != GameMng_1.default.squirrel.actionState && "blocked" != GameMng_1.default.squirrel.actionState && GameMng_1.default.endGameEvent("block");
            break;

           case 4:
            "jumping" != GameMng_1.default.squirrel.actionState && "falling" != GameMng_1.default.squirrel.actionState && "blocked" != GameMng_1.default.squirrel.actionState && GameMng_1.default.endGameEvent("block");
            break;

           case 5:
            GameMng_1.default.squirrel.checkHit(0) && "blocked" != GameMng_1.default.squirrel.actionState && GameMng_1.default.endGameEvent("block");
          }
          if (O < 2 && this.aBranches[O].blockType >= 6 && ("magnet" == this.aBranches[O].powerUpState || GameMng_1.default.squirrel.checkHit(Math.round(this.aBranches[O].coinOffset)))) {
            if (this.aBranches[O].blockType < 11) {
              this.moveSpeed += 5;
              TweenMax.to(this, .5, {
                scrollSpeed: this.moveSpeed + 25 * GameMng_1.default.aPowerUpBarData[0],
                ease: "Quad.easeIn"
              });
            } else GameMng_1.default.powerUpEvent(this.aBranches[O].blockType - 11);
            this.aBranches[O].blockType = 0;
          }
          if (this.aBranches[O].blockType > 0) {
            var spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds["block" + this.aBranches[O].blockType]);
            var rect = spriteFrame.getRect();
            var d = rect.x, t = rect.y, s = rect.width, A = rect.height, p = 0;
            if (this.aBranches[O].blockType >= 6) if ("magnet" != this.aBranches[O].powerUpState) p = 75 * Math.round(this.aBranches[O].coinOffset); else {
              p += 75 * Math.round(this.aBranches[O].coinOffset) * (O / this.segNum);
              p = -(GameMng_1.default.squirrel.x - this.aBranches[O].xPos) * (1 - O / this.segNum);
            }
            DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos - (s / 2 + p) * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos - (A * this.aBranches[O].scale - this.oBranchImgData.oData.spriteHeight / 2 * this.aBranches[O].scale * this.aBranches[O].heightFactor) * this.entireScale, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.entireScale);
          }
          if ((0 == this.aBranches[O].blockType || this.aBranches[O].blockType >= 5) && this.aBranches[O].skewFrame > -1 && 0 == this.aBranches[O].gapState && this.aBranches[O].startSkewFrame <= 29) {
            var spriteFrame = this.oBranchElementsImgData.getSpriteFrame(OImageIds_1.oImageIds["plant" + this.aBranches[O].count % 4]);
            var rect = spriteFrame.getRect();
            var d = rect.x, t = rect.y, s = rect.width, A = rect.height;
            DrawImage_1.default.drawImage2(spriteFrame, this.aBranches[O].xPos - s / 2 * this.aBranches[O].scale * this.entireScale + this.turnOffset * (25 * O), this.aBranches[O].yPos - (A * this.aBranches[O].scale - this.oBranchImgData.oData.spriteHeight / 2 * this.aBranches[O].scale * this.aBranches[O].heightFactor) * this.entireScale, s * this.aBranches[O].scale * this.entireScale, A * this.aBranches[O].scale * this.entireScale);
          }
          if (1 == O && "blocked" != GameMng_1.default.squirrel.actionState) {
            GameMng_1.default.squirrel.update2(delta);
            GameMng_1.default.squirrel.render(delta);
          }
        }
        if (this.aBranches.length <= 1 || "blocked" == GameMng_1.default.squirrel.actionState) {
          GameMng_1.default.squirrel.update2(delta);
          GameMng_1.default.squirrel.render(delta);
        }
      };
      __decorate([ property({
        type: cc.Texture2D
      }) ], Branches.prototype, "oBranchImg", void 0);
      __decorate([ property({
        type: cc.SpriteAtlas
      }) ], Branches.prototype, "oBranchElementsImgData", void 0);
      __decorate([ property({
        type: cc.Node
      }) ], Branches.prototype, "container", void 0);
      Branches = __decorate([ ccclass ], Branches);
      return Branches;
    }(cc.Component);
    exports.Branches = Branches;
    cc._RF.pop();
  }, {
    "../../../data/GameDataCenter": "GameDataCenter",
    "./DrawImage": "DrawImage",
    "./GameMng": "GameMng",
    "./OImageIds": "OImageIds"
  } ],
  Calculate: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "aa2e66BuFxL5anS1peVwkIc", "Calculate");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.calculate = function(input) {
      try {
        var tokens = lex(input);
        var parseTree = parse(tokens);
        var output = evaluate(parseTree);
        return output;
      } catch (e) {
        return e;
      }
    };
    window["calculate"] = exports.calculate;
    var evaluate = function(parseTree) {
      var operators = {
        "+": function(a, b) {
          return a + b;
        },
        "-": function(a, b) {
          if ("undefined" === typeof b) return -a;
          return a - b;
        },
        "*": function(a, b) {
          return a * b;
        },
        "/": function(a, b) {
          return a / b;
        },
        "%": function(a, b) {
          return a % b;
        },
        "^": function(a, b) {
          return Math.pow(a, b);
        }
      };
      var variables = {
        pi: Math.PI,
        e: Math.E
      };
      var functions = {
        sin: Math.sin,
        cos: Math.cos,
        tan: Math.cos,
        asin: Math.asin,
        acos: Math.acos,
        atan: Math.atan,
        abs: Math.abs,
        round: Math.round,
        ceil: Math.ceil,
        floor: Math.floor,
        log: Math.log,
        exp: Math.exp,
        sqrt: Math.sqrt,
        max: Math.max,
        min: Math.min,
        random: Math.random
      };
      var args = {};
      var parseNode = function(node) {
        if ("number" === node.type) return node.value;
        if (operators[node.type]) {
          if (node.left) return operators[node.type](parseNode(node.left), parseNode(node.right));
          return operators[node.type](parseNode(node.right));
        }
        if ("identifier" === node.type) {
          var value = args.hasOwnProperty(node.value) ? args[node.value] : variables[node.value];
          if ("undefined" === typeof value) throw node.value + " is undefined";
          return value;
        }
        if ("assign" === node.type) variables[node.name] = parseNode(node.value); else {
          if ("call" === node.type) {
            for (var i = 0; i < node.args.length; i++) node.args[i] = parseNode(node.args[i]);
            return functions[node.name].apply(null, node.args);
          }
          "function" === node.type && (functions[node.name] = function() {
            for (var i = 0; i < node.args.length; i++) args[node.args[i].value] = arguments[i];
            var ret = parseNode(node.value);
            args = {};
            return ret;
          });
        }
      };
      var output = null;
      if (1 == parseTree.length) {
        var value = parseNode(parseTree[0]);
        "undefined" !== typeof value && (output = value);
      }
      return output;
    };
    var lex = function(input) {
      var isOperator = function(c) {
        return /[+\-*\/\^%=(),]/.test(c);
      }, isDigit = function(c) {
        return /[0-9]/.test(c);
      }, isWhiteSpace = function(c) {
        return /\s/.test(c);
      }, isIdentifier = function(c) {
        return "string" === typeof c && !isOperator(c) && !isDigit(c) && !isWhiteSpace(c);
      };
      var tokens = [], c, i = 0;
      var advance = function() {
        return c = input[++i];
      };
      var addToken = function(type, value) {
        tokens.push({
          type: type,
          value: value
        });
      };
      while (i < input.length) {
        c = input[i];
        if (isWhiteSpace(c)) advance(); else if (isOperator(c)) {
          addToken(c);
          advance();
        } else if (isDigit(c)) {
          var num = c;
          while (isDigit(advance())) num += c;
          if ("." === c) do {
            num += c;
          } while (isDigit(advance()));
          num = parseFloat(num);
          if (!isFinite(num)) throw "Number is too large or too small for a 64-bit double.";
          addToken("number", num);
        } else {
          if (!isIdentifier(c)) throw "Unrecognized token.";
          var idn = c;
          while (isIdentifier(advance())) idn += c;
          addToken("identifier", idn);
        }
      }
      addToken("(end)");
      return tokens;
    };
    var parse = function(tokens) {
      var symbols = {}, symbol = function(id, nud, lbp, led) {
        var sym = symbols[id] || {};
        symbols[id] = {
          lbp: sym.lbp || lbp,
          nud: sym.nud || nud,
          led: sym.lef || led
        };
      };
      var interpretToken = function(token) {
        var sym = Object.create(symbols[token.type]);
        sym.type = token.type;
        sym.value = token.value;
        return sym;
      };
      var i = 0, token = function() {
        return interpretToken(tokens[i]);
      };
      var advance = function() {
        i++;
        return token();
      };
      var expression = function(rbp) {
        var left, t = token();
        advance();
        if (!t.nud) throw "Unexpected token: " + t.type;
        left = t.nud(t);
        while (rbp < token().lbp) {
          t = token();
          advance();
          if (!t.led) throw "Unexpected token: " + t.type;
          left = t.led(left);
        }
        return left;
      };
      var infix = function(id, lbp, rbp, led) {
        rbp = rbp || lbp;
        symbol(id, null, lbp, led || function(left) {
          return {
            type: id,
            left: left,
            right: expression(rbp)
          };
        });
      }, prefix = function(id, rbp) {
        symbol(id, function() {
          return {
            type: id,
            right: expression(rbp)
          };
        });
      };
      symbol(",");
      symbol(")");
      symbol("(end)");
      symbol("number", function(number) {
        return number;
      });
      symbol("identifier", function(name) {
        if ("(" === token().type) {
          var args = [];
          if (")" === tokens[i + 1].type) advance(); else {
            do {
              advance();
              args.push(expression(2));
            } while ("," === token().type);
            if (")" !== token().type) throw "Expected closing parenthesis ')'";
          }
          advance();
          return {
            type: "call",
            args: args,
            name: name.value
          };
        }
        return name;
      });
      symbol("(", function() {
        var value = expression(2);
        if (")" !== token().type) throw "Expected closing parenthesis ')'";
        advance();
        return value;
      });
      prefix("-", 7);
      infix("^", 6, 5);
      infix("*", 4);
      infix("/", 4);
      infix("%", 4);
      infix("+", 3);
      infix("-", 3);
      infix("=", 1, 2, function(left) {
        if ("call" === left.type) {
          for (var i = 0; i < left.args.length; i++) if ("identifier" !== left.args[i].type) throw "Invalid argument name";
          return {
            type: "function",
            name: left.name,
            args: left.args,
            value: expression(2)
          };
        }
        if ("identifier" === left.type) return {
          type: "assign",
          name: left.value,
          value: expression(2)
        };
        throw "Invalid lvalue";
      });
      var parseTree = [];
      while ("(end)" !== token().type) parseTree.push(expression(0));
      return parseTree;
    };
    cc._RF.pop();
  }, {} ],
  CloseToBorderComponent: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "6bfe4RRvIFCjpSNWCSrwW/v", "CloseToBorderComponent");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var CloseToBorderComponent = function(_super) {
      __extends(CloseToBorderComponent, _super);
      function CloseToBorderComponent() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.closeToBottom = false;
        _this.marginBottomInPx = 0;
        return _this;
      }
      CloseToBorderComponent.prototype.onLoad = function() {
        this.closeToBottom && (this.node.position = cc.v2(this.node.position.x, -this.node.parent.height / 2 + this.node.anchorY * this.node.height + this.marginBottomInPx));
      };
      __decorate([ property({
        tooltip: "\u662f\u5426\u7d27\u8d34\u4e0b\u65b9\uff0c\u4e0d\u80fd\u548c\u7d27\u8d34\u4e0a\u65b9\u540c\u65f6\u4f7f\u7528"
      }) ], CloseToBorderComponent.prototype, "closeToBottom", void 0);
      __decorate([ property({
        tooltip: "\u8ddd\u79bb\u4e0b\u65b9\u7684\u8ddd\u79bb\uff08px\uff09\uff0c\u5f00\u542f\u7d27\u8d34\u4e0b\u65b9\u65f6\u4f7f\u7528"
      }) ], CloseToBorderComponent.prototype, "marginBottomInPx", void 0);
      CloseToBorderComponent = __decorate([ ccclass ], CloseToBorderComponent);
      return CloseToBorderComponent;
    }(cc.Component);
    exports.default = CloseToBorderComponent;
    cc._RF.pop();
  }, {} ],
  CommonButton: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "eae47eSPItCcrEwIWyMFgs9", "CommonButton");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var CommonButton = function(_super) {
      __extends(CommonButton, _super);
      function CommonButton() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      CommonButton.prototype.onClick = function(event, cusData) {};
      CommonButton = __decorate([ ccclass ], CommonButton);
      return CommonButton;
    }(cc.Component);
    exports.default = CommonButton;
    cc._RF.pop();
  }, {} ],
  ConfigMgr: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2fb10ZgrFxNAonv9idBx965", "ConfigMgr");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ResourceLoader_1 = require("../main/resource/ResourceLoader");
    var ConfigMgr = function() {
      function ConfigMgr() {
        this.levelConfs = null;
        this.cmUpgrades = null;
      }
      ConfigMgr.GetInst = function() {
        null == this.mIns && (this.mIns = new ConfigMgr());
        return this.mIns;
      };
      ConfigMgr.prototype.LoadConfigs = function(oncomplated) {
        var _this = this;
        var loadArr = [];
        ResourceLoader_1.default.getInstance().loadRes("config/DataConfig", cc.JsonAsset, function(err, res) {
          _this.levelConfs = res.json.Level;
          _this.cmUpgrades = res.json.cm_upgrade;
          oncomplated && oncomplated();
        });
      };
      ConfigMgr.prototype.unzip = function(zipData, objArr, oncomplated) {
        var newZip = new JSZip();
        newZip.loadAsync(zipData).then(function(zip) {
          var count = objArr.length;
          var _fun = function() {
            count--;
            count <= 0 && oncomplated && oncomplated();
          };
          objArr.forEach(function(obj) {
            zip.file("config/" + obj.res + ".json").async("string").then(function(data) {
              try {
                var json = JSON.parse(data);
                obj.func(null, {
                  json: json
                });
                _fun();
              } catch (e) {
                cc.error("config/" + obj.res + ".json", e);
              }
            });
          });
        });
      };
      ConfigMgr.prototype.QueryLevel = function(lv) {
        if (lv < this.levelConfs.length) return this.levelConfs[lv - 1];
        return this.levelConfs[this.levelConfs.length - 1];
      };
      ConfigMgr.prototype.QueryCMUpgrade = function(lv) {
        if (lv < this.cmUpgrades.length) return this.cmUpgrades[lv - 1];
        return this.cmUpgrades[this.cmUpgrades.length - 1];
      };
      ConfigMgr.mIns = null;
      return ConfigMgr;
    }();
    exports.ConfigMgr = ConfigMgr;
    false;
    cc._RF.pop();
  }, {
    "../main/resource/ResourceLoader": "ResourceLoader"
  } ],
  ConstValue: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "95d441KXZVDFLVQteM8WZ4E", "ConstValue");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ConstValue = function() {
      function ConstValue() {}
      ConstValue.CONFIG_FILE_DIR = "config/";
      ConstValue.PREFAB_UI_DIR = "prefab/ui/";
      ConstValue.AUDIO_DIR = "audio/";
      return ConstValue;
    }();
    exports.ConstValue = ConstValue;
    cc._RF.pop();
  }, {} ],
  ContentAdapter: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4010diIR0ZMhJ1/d++3vQ8Y", "ContentAdapter");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var ContentAdapter = function(_super) {
      __extends(ContentAdapter, _super);
      function ContentAdapter() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      ContentAdapter.prototype.onLoad = function() {
        var srcScaleForShowAll = Math.max(cc.view.getCanvasSize().width / this.node.width, cc.view.getCanvasSize().height / this.node.height);
        var realWidth = this.node.width * srcScaleForShowAll;
        var realHeight = this.node.height * srcScaleForShowAll;
        this.node.width = this.node.width * (cc.view.getCanvasSize().width / realWidth);
        this.node.height = this.node.height * (cc.view.getCanvasSize().height / realHeight);
      };
      ContentAdapter = __decorate([ ccclass, menu("Adapter/ContentAdapter") ], ContentAdapter);
      return ContentAdapter;
    }(cc.Component);
    exports.default = ContentAdapter;
    cc._RF.pop();
  }, {} ],
  1: [ function(require, module, exports) {}, {} ],
  2: [ function(require, module, exports) {
    var process = module.exports = {};
    var cachedSetTimeout;
    var cachedClearTimeout;
    function defaultSetTimout() {
      throw new Error("setTimeout has not been defined");
    }
    function defaultClearTimeout() {
      throw new Error("clearTimeout has not been defined");
    }
    (function() {
      try {
        cachedSetTimeout = "function" === typeof setTimeout ? setTimeout : defaultSetTimout;
      } catch (e) {
        cachedSetTimeout = defaultSetTimout;
      }
      try {
        cachedClearTimeout = "function" === typeof clearTimeout ? clearTimeout : defaultClearTimeout;
      } catch (e) {
        cachedClearTimeout = defaultClearTimeout;
      }
    })();
    function runTimeout(fun) {
      if (cachedSetTimeout === setTimeout) return setTimeout(fun, 0);
      if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
        cachedSetTimeout = setTimeout;
        return setTimeout(fun, 0);
      }
      try {
        return cachedSetTimeout(fun, 0);
      } catch (e) {
        try {
          return cachedSetTimeout.call(null, fun, 0);
        } catch (e) {
          return cachedSetTimeout.call(this, fun, 0);
        }
      }
    }
    function runClearTimeout(marker) {
      if (cachedClearTimeout === clearTimeout) return clearTimeout(marker);
      if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
        cachedClearTimeout = clearTimeout;
        return clearTimeout(marker);
      }
      try {
        return cachedClearTimeout(marker);
      } catch (e) {
        try {
          return cachedClearTimeout.call(null, marker);
        } catch (e) {
          return cachedClearTimeout.call(this, marker);
        }
      }
    }
    var queue = [];
    var draining = false;
    var currentQueue;
    var queueIndex = -1;
    function cleanUpNextTick() {
      if (!draining || !currentQueue) return;
      draining = false;
      currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1;
      queue.length && drainQueue();
    }
    function drainQueue() {
      if (draining) return;
      var timeout = runTimeout(cleanUpNextTick);
      draining = true;
      var len = queue.length;
      while (len) {
        currentQueue = queue;
        queue = [];
        while (++queueIndex < len) currentQueue && currentQueue[queueIndex].run();
        queueIndex = -1;
        len = queue.length;
      }
      currentQueue = null;
      draining = false;
      runClearTimeout(timeout);
    }
    process.nextTick = function(fun) {
      var args = new Array(arguments.length - 1);
      if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) args[i - 1] = arguments[i];
      queue.push(new Item(fun, args));
      1 !== queue.length || draining || runTimeout(drainQueue);
    };
    function Item(fun, array) {
      this.fun = fun;
      this.array = array;
    }
    Item.prototype.run = function() {
      this.fun.apply(null, this.array);
    };
    process.title = "browser";
    process.browser = true;
    process.env = {};
    process.argv = [];
    process.version = "";
    process.versions = {};
    function noop() {}
    process.on = noop;
    process.addListener = noop;
    process.once = noop;
    process.off = noop;
    process.removeListener = noop;
    process.removeAllListeners = noop;
    process.emit = noop;
    process.prependListener = noop;
    process.prependOnceListener = noop;
    process.listeners = function(name) {
      return [];
    };
    process.binding = function(name) {
      throw new Error("process.binding is not supported");
    };
    process.cwd = function() {
      return "/";
    };
    process.chdir = function(dir) {
      throw new Error("process.chdir is not supported");
    };
    process.umask = function() {
      return 0;
    };
  }, {} ],
  DataUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d0ce5VQvJtCUZLxTFu2Oq3d", "DataUtil");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var DataUtil = function() {
      function DataUtil() {}
      DataUtil.getRandom = function(min, max) {
        return Math.floor(Math.random() * (max - min) + min);
      };
      DataUtil.judgeProbability = function(probability) {
        probability *= 100;
        var odds = Math.floor(100 * Math.random());
        return odds < probability;
      };
      DataUtil.judgeProbability2 = function(probabilityArr) {
        var probabilityArr2 = [];
        probabilityArr.forEach(function(num) {
          probabilityArr2.push(probabilityArr2.length > 0 ? num + probabilityArr2[probabilityArr2.length - 1] : num);
        });
        var random = this.getRandom(0, probabilityArr2[probabilityArr2.length - 1]);
        for (var i = 0; i < probabilityArr2.length; i++) if (random < probabilityArr2[i]) return i;
      };
      DataUtil.deepCopy = function(obj, cache) {
        var _this = this;
        void 0 === cache && (cache = []);
        if (null === obj || "object" !== typeof obj) return obj;
        var hit = cache.filter(function(c) {
          return c.original === obj;
        })[0];
        if (hit) return hit.copy;
        var copy = Array.isArray(obj) ? [] : {};
        cache.push({
          original: obj,
          copy: copy
        });
        Object.keys(obj).forEach(function(key) {
          copy[key] = _this.deepCopy(obj[key], cache);
        });
        return copy;
      };
      DataUtil.dataClean = function(obj, objLast, cache) {
        var _this = this;
        void 0 === cache && (cache = []);
        if (null === obj || "object" !== typeof obj) return obj != objLast ? obj : null;
        var hit = cache.filter(function(c) {
          return c.original === obj;
        })[0];
        if (hit) return hit.copy;
        if (Array.isArray(obj)) return null == objLast || obj.toString() != objLast.toString() ? obj : null;
        var copy_1 = {};
        cache.push({
          original: obj,
          copy: copy_1
        });
        Object.keys(obj).forEach(function(key) {
          var last = null;
          objLast && objLast[key] && (last = objLast[key]);
          var result = _this.dataClean(obj[key], last, cache);
          null != result && (copy_1[key] = _this.dataClean(obj[key], last, cache));
        });
        return copy_1;
      };
      DataUtil.dataAssign = function(objOrg, obj, cache) {
        var _this = this;
        void 0 === cache && (cache = []);
        if (null === obj || "object" !== typeof obj) return;
        var hit = cache.filter(function(c) {
          return c.original === obj;
        })[0];
        if (hit) return;
        cache.push({
          original: obj
        });
        Object.keys(obj).forEach(function(key) {
          void 0 == objOrg[key] ? objOrg[key] = obj[key] : _this.dataAssign(objOrg[key], obj[key], cache);
        });
        return;
      };
      DataUtil.dataAssignCopy = function(objOrg, obj, cache) {
        var _this = this;
        void 0 === cache && (cache = []);
        if (null === obj || "object" !== typeof obj) return;
        var hit = cache.filter(function(c) {
          return c.original === obj;
        })[0];
        if (hit) return;
        cache.push({
          original: obj
        });
        Object.keys(obj).forEach(function(key) {
          void 0 == objOrg[key] || "object" !== typeof objOrg[key] ? objOrg[key] = obj[key] : _this.dataAssignCopy(objOrg[key], obj[key], cache);
        });
        return;
      };
      DataUtil.distance = function(p1, p2) {
        var dx = Math.abs(p2.x - p1.x);
        var dy = Math.abs(p2.y - p1.y);
        return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
      };
      DataUtil.getPoint = function(r, ox, oy, count) {
        var point = [];
        var radians = Math.PI / 180 * Math.round(360 / count), i = 0;
        for (;i < count; i++) {
          var x = ox + r * Math.sin(radians * i), y = oy + r * Math.cos(radians * i);
          point.unshift({
            x: x,
            y: y
          });
        }
        return point;
      };
      DataUtil.GetSinVal = function(angle) {
        return Math.sin(angle * Math.PI / 180);
      };
      DataUtil.GetCosVal = function(angle) {
        return Math.cos(angle * Math.PI / 180);
      };
      DataUtil.GetSpeedX = function(ori, angle) {
        ori = Math.abs(ori);
        if (0 === angle) return ori;
        if (90 === angle) return 0;
        if (180 === angle) return -ori;
        if (270 === angle) return 0;
        return this.GetCosVal(angle) * ori;
      };
      DataUtil.GetSpeedY = function(ori, angle) {
        ori = Math.abs(ori);
        if (0 === angle) return 0;
        if (90 === angle) return ori;
        if (180 === angle) return 0;
        if (270 === angle) return -ori;
        return this.GetSinVal(angle) * ori;
      };
      DataUtil.AngleToVector = function(angle) {
        if (0 === angle) return cc.v2(1, 0);
        if (90 === angle) return cc.v2(0, 1);
        if (180 === angle) return cc.v2(-1, 0);
        if (270 === angle) return cc.v2(0, -1);
        return cc.v2(this.GetSpeedX(1, angle), this.GetSpeedY(1, angle));
      };
      DataUtil.localConvertWorldPointAR = function(node) {
        if (node) return node.convertToWorldSpaceAR(cc.v2(0, 0));
        return null;
      };
      DataUtil.localConvertWorldPoint = function(node) {
        if (node) return node.convertToWorldSpace(cc.v2(0, 0));
        return null;
      };
      DataUtil.worldConvertLocalPointAR = function(node, worldPoint) {
        if (node) return node.convertToNodeSpaceAR(worldPoint);
        return null;
      };
      DataUtil.worldConvertLocalPoint = function(node, worldPoint) {
        if (node) return node.convertToNodeSpace(worldPoint);
        return null;
      };
      DataUtil.convetOtherNodeSpace = function(node, targetNode) {
        if (!node || !targetNode) return null;
        var worldPoint = this.localConvertWorldPoint(node);
        return this.worldConvertLocalPoint(targetNode, worldPoint);
      };
      DataUtil.convetOtherNodeSpaceAR = function(node, targetNode) {
        if (!node || !targetNode) return null;
        var worldPoint = this.localConvertWorldPointAR(node);
        return this.worldConvertLocalPointAR(targetNode, worldPoint);
      };
      DataUtil.getNowDateStemp = function() {
        return Math.floor(new Date().valueOf() / 1e3) + this.timeDifference;
      };
      DataUtil.timeDifference = 0;
      return DataUtil;
    }();
    exports.default = DataUtil;
    false;
    cc._RF.pop();
  }, {} ],
  DragonBoneUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "af1282euDNBabUZLUi8fjaJ", "DragonBoneUtil");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property, executeInEditMode = _a.executeInEditMode, playOnFocus = _a.playOnFocus;
    var DefaultFramesEnum = cc.Enum({
      "<None>": 0
    });
    function setEnumAttr(obj, propName, enumDef) {
      cc.Class.Attr.setClassAttr(obj, propName, "type", "Enum");
      cc.Class.Attr.setClassAttr(obj, propName, "enumList", cc.Enum.getList(enumDef));
    }
    var DragonEvent = function() {
      function DragonEvent() {
        this.dragonBoneUtil = null;
        this.eventName = "";
        this.bone = "";
        this.events = [];
      }
      DragonEvent.prototype.init = function(event, dragonBoneUtil) {
        this.dragonBoneUtil = dragonBoneUtil;
        this.bone = event.bone;
        this.eventName = event.name;
        var frameObj = dragonBoneUtil.getFrameObj();
        frameObj && frameObj[this.eventName] && (this.events = frameObj[this.eventName]);
      };
      DragonEvent.prototype.setValue = function(value) {
        if (!this.dragonBoneUtil) return;
        var frameObj = this.dragonBoneUtil.getFrameObj();
        if (frameObj) frameObj[this.eventName] = value; else {
          var arma = this.dragonBoneUtil.eventMaps[this.dragonBoneUtil.bones.armatureName];
          arma || (arma = this.dragonBoneUtil.eventMaps[this.dragonBoneUtil.bones.armatureName] = {});
          var anima = arma[this.dragonBoneUtil.bones.animationName];
          anima || (anima = arma[this.dragonBoneUtil.bones.animationName] = {});
          var frameObj_1 = anima[this.dragonBoneUtil.events[this.dragonBoneUtil.frameIndex].frameNum];
          frameObj_1 || (frameObj_1 = anima[this.dragonBoneUtil.events[this.dragonBoneUtil.frameIndex].frameNum] = {});
          frameObj_1[this.eventName] = value;
        }
      };
      __decorate([ property({
        readonly: true
      }) ], DragonEvent.prototype, "eventName", void 0);
      __decorate([ property({
        visible: function() {
          return this.bone;
        },
        readonly: true,
        tooltip: "\u9aa8\u9abc\u63d2\u69fd"
      }) ], DragonEvent.prototype, "bone", void 0);
      __decorate([ property({
        type: cc.Component.EventHandler,
        displayName: "Events",
        tooltip: "\u8981\u89e6\u53d1\u7684\u4e8b\u4ef6\uff0ccusData\u53ef\u4ee5\u5e26\u53c2\u6570 json\u683c\u5f0f"
      }) ], DragonEvent.prototype, "events", void 0);
      DragonEvent = __decorate([ ccclass("DragonEvent") ], DragonEvent);
      return DragonEvent;
    }();
    var DragonBoneUtil = function(_super) {
      __extends(DragonBoneUtil, _super);
      function DragonBoneUtil() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.bones = null;
        _this.animationState = null;
        _this.eventMaps = {};
        _this._lastArmatureName = "";
        _this._lastAnimaName = "";
        _this._frameIndex = 0;
        _this._showCusEvents = false;
        _this._cusEvents = [];
        _this._showSoundEvents = false;
        _this._soundEvent = null;
        _this.events = [];
        _this._updateEventEnum = false;
        _this.lateUpdate = false;
        _this._frameNow = 0;
        return _this;
      }
      Object.defineProperty(DragonBoneUtil.prototype, "frameIndex", {
        get: function() {
          return this._frameIndex;
        },
        set: function(value) {
          var _this = this;
          this._frameIndex = value;
          if (value < 0) return;
          var frame = this.events[value].frame;
          var cusEvents = [];
          frame.events && frame.events.forEach(function(event) {
            var dragonEvent = new DragonEvent();
            dragonEvent.init(event, _this);
            cusEvents.push(dragonEvent);
          });
          this.cusEvents = cusEvents;
          this._showCusEvents = cusEvents.length > 0;
          if (frame.sound) {
            this.soundEvent = new DragonEvent();
            this.soundEvent.init({
              name: frame.sound
            }, this);
            this._showSoundEvents = true;
          } else {
            this.soundEvent = null;
            this._showSoundEvents = false;
          }
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(DragonBoneUtil.prototype, "cusEvents", {
        get: function() {
          return this._cusEvents;
        },
        set: function(value) {
          this._cusEvents = value;
          this._cusEvents.forEach(function(dragonEvent) {
            dragonEvent.setValue(dragonEvent.events);
          });
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(DragonBoneUtil.prototype, "soundEvent", {
        get: function() {
          return this._soundEvent;
        },
        set: function(value) {
          this._soundEvent = value;
          this._soundEvent && this._soundEvent.setValue(this._soundEvent.events);
        },
        enumerable: true,
        configurable: true
      });
      DragonBoneUtil.prototype.onLoad = function() {
        this.bones = this.node.getComponent(dragonBones.ArmatureDisplay);
      };
      DragonBoneUtil.prototype.start = function() {
        false;
        this.addEvent();
      };
      DragonBoneUtil.prototype.addEvent = function() {
        var _this = this;
        if (!this.bones) return;
        this.bones.on(dragonBones.EventObject.FRAME_EVENT, function(event) {
          var events = _this.getFrameObj(event);
          if (events) {
            var shoudDoEvents = events[event.name];
            shoudDoEvents && cc.Component.EventHandler.emitEvents(shoudDoEvents, event);
          }
        });
        this.bones.on(dragonBones.EventObject.SOUND_EVENT, function(event) {
          var events = _this.getFrameObj(event);
          if (events) {
            var shoudDoEvents = events[event.name];
            shoudDoEvents && cc.Component.EventHandler.emitEvents(shoudDoEvents, event);
          }
        });
      };
      DragonBoneUtil.prototype.testEvent = function(event, cusData) {
        cc.log(this._frameNow + "\u5e27:------type:" + event.type + "------name:" + event.name + "------cusData:" + cusData);
      };
      DragonBoneUtil.prototype.getFrameObj = function(event) {
        try {
          var frameObj;
          false;
          var time = event.time;
          var animationData = event.animationState.animationData;
          var totalTime = animationData.duration;
          var frameCount = animationData.frameCount;
          var frame = Math.round(time / totalTime * frameCount);
          this._frameNow = frame;
          var frameObj = this.eventMaps[this.bones.armatureName][this.bones.animationName][frame];
          return frameObj;
        } catch (e) {
          return null;
        }
      };
      DragonBoneUtil.prototype.setBonesVisible = function(boneName, state) {
        var attachUtil = this.bones.attachUtil;
        var armature = attachUtil._armature;
        var bones = armature.getBones(), findBone;
        for (var i = 0, l = bones.length; i < l; i++) {
          var bone = bones[i];
          boneName === bone.name && (findBone = bone);
        }
        findBone ? findBone.visible = state : cc.error(this.bones.armatureName + "-" + this.bones.animationName + "\u6ca1\u6709\u8fd9\u4e2a\u63d2\u69fd:" + boneName);
      };
      DragonBoneUtil.prototype.getAttachedNode = function(boneName) {
        var attachUtil = this.bones.attachUtil;
        var nodes = attachUtil.getAttachedNodes(boneName);
        0 == nodes.length && (nodes = attachUtil.generateAttachedNodes(boneName));
        return nodes;
      };
      DragonBoneUtil.prototype.play = function(animaName, playTimes) {
        void 0 === playTimes && (playTimes = -1);
        this.animationState = this.bones.playAnimation(animaName, playTimes);
      };
      DragonBoneUtil.prototype.parse = function() {
        this.animationState.stop();
      };
      DragonBoneUtil.prototype.resume = function() {
        this.animationState.play();
      };
      DragonBoneUtil.prototype.setTimeScale = function(num) {
        this.animationState.timeScale = num;
      };
      __decorate([ property({
        visible: false
      }) ], DragonBoneUtil.prototype, "eventMaps", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_lastArmatureName", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_lastAnimaName", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_frameIndex", void 0);
      __decorate([ property({
        type: DefaultFramesEnum,
        displayName: "\u5e27\u4e8b\u4ef6",
        visible: function() {
          return -1 != this._frameIndex;
        }
      }) ], DragonBoneUtil.prototype, "frameIndex", null);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_showCusEvents", void 0);
      __decorate([ property({
        type: DragonEvent,
        visible: function() {
          return this._showCusEvents;
        },
        readonly: true
      }) ], DragonBoneUtil.prototype, "cusEvents", null);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_showSoundEvents", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "_soundEvent", void 0);
      __decorate([ property({
        type: DragonEvent,
        visible: function() {
          return this._showSoundEvents;
        },
        readonly: true
      }) ], DragonBoneUtil.prototype, "soundEvent", null);
      __decorate([ property({
        editorOnly: true
      }) ], DragonBoneUtil.prototype, "events", void 0);
      DragonBoneUtil = __decorate([ ccclass, executeInEditMode, menu("Util/DragonBoneUtil") ], DragonBoneUtil);
      return DragonBoneUtil;
    }(cc.Component);
    exports.default = DragonBoneUtil;
    cc._RF.pop();
  }, {} ],
  DrawImage: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f519dJ6aW1IELVCwzfJ+G45", "DrawImage");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var DrawImage = function() {
      function DrawImage() {
        this.container = null;
        this.spriteFrameMap = new Map();
        this.spritePool = new NodePool();
        this.canvans = null;
      }
      DrawImage.prototype.drawImage = function(tex, srcX, srcY, srcHeight, srcWidth, dstX, dstY, dstWidth, dstHeight) {
        var map = this.spriteFrameMap.get(tex.url);
        if (!map) {
          map = new Map();
          this.spriteFrameMap.set(tex.url, map);
        }
        var key = srcX << 16 | srcY;
        var spriteFrame = map.get(key);
        if (!spriteFrame) {
          spriteFrame = new cc.SpriteFrame(tex);
          spriteFrame.setRect(cc.rect(srcX, srcY, srcHeight, srcWidth));
          map.set(key, spriteFrame);
        }
        var sprite = this.spritePool.get();
        if (!sprite) {
          sprite = new cc.Node();
          sprite.setAnchorPoint(0, 1);
          sprite.addComponent(cc.Sprite).sizeMode = cc.Sprite.SizeMode.CUSTOM;
          sprite.parent = this.container;
        }
        sprite.getComponent(cc.Sprite).spriteFrame = spriteFrame;
        sprite.setPosition(dstX, this.canvans.height - dstY);
        sprite.setContentSize(dstWidth, dstHeight);
      };
      DrawImage.prototype.drawImage2 = function(tex, dstX, dstY, dstWidth, dstHeight) {
        var spriteFrame = tex;
        var sprite = this.spritePool.get();
        if (!sprite) {
          sprite = new cc.Node();
          sprite.setAnchorPoint(0, 1);
          sprite.addComponent(cc.Sprite).sizeMode = cc.Sprite.SizeMode.CUSTOM;
          sprite.parent = this.container;
        }
        sprite.getComponent(cc.Sprite).spriteFrame = spriteFrame;
        sprite.setPosition(dstX, this.canvans.height - dstY);
        sprite.setContentSize(dstWidth, dstHeight);
      };
      DrawImage.prototype.recover = function(node) {
        for (var index = node._children.length; index > 0; index--) {
          var child = node.children[index - 1];
          this.spritePool.put(child);
        }
      };
      return DrawImage;
    }();
    exports.DrawImage = DrawImage;
    var NodePool = function(_super) {
      __extends(NodePool, _super);
      function NodePool() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this._pool = [];
        return _this;
      }
      NodePool.prototype.put = function(obj) {
        if (obj && -1 === this._pool.indexOf(obj)) {
          obj["_oldOpacity"] = obj.opacity;
          obj.opacity = 0;
          this._pool.push(obj);
        }
      };
      NodePool.prototype.get = function() {
        var last = this._pool.length - 1;
        if (last < 0) return null;
        var obj = this._pool[last];
        this._pool.length = last;
        obj.opacity = obj["_oldOpacity"];
        return obj;
      };
      return NodePool;
    }(cc.NodePool);
    var ctx = new DrawImage();
    exports.default = ctx;
    cc._RF.pop();
  }, {} ],
  EditWidget: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "a19c6wfl21O2bSj0L1WAZ1b", "EditWidget");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, inspector = _a.inspector, property = _a.property;
    var EditWidget = function(_super) {
      __extends(EditWidget, _super);
      function EditWidget() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      EditWidget.prototype._validateTargetInDEV = function() {};
      EditWidget = __decorate([ ccclass, menu("Adapter/Widget"), inspector("packages://inspector/inspectors/comps/ccwidget.js") ], EditWidget);
      return EditWidget;
    }(cc.Widget);
    exports.default = EditWidget;
    cc._RF.pop();
  }, {} ],
  EventConst: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d22610AXWdOD7hw0qIW5HEw", "EventConst");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var SocketEvent = function() {
      function SocketEvent() {}
      SocketEvent.SOCKET_OPEN = "SOCKET_OPEN";
      SocketEvent.SOCKET_CLOSE = "SOCKET_CLOSE";
      return SocketEvent;
    }();
    exports.SocketEvent = SocketEvent;
    var GameEvent = function() {
      function GameEvent() {}
      GameEvent.LOGIN_SUCCESS = "LOGIN_SUCCESS";
      GameEvent.SHOW_ONE_PEOPLE = "SHOW_ONE_PEOPLE";
      GameEvent.SHOW_ONE_CAR = "SHOW_ONE_CAR";
      GameEvent.NEED_COIN = "NEED_COIN";
      GameEvent.NEED_DIAMOND = "NEED_DIAMOND";
      GameEvent.MAP_LV_UP = "MAP_LV_UP";
      GameEvent.PLAYER_LV_UP = "PLAYER_LV_UP";
      GameEvent.SHOW_BUST_EFFECT = "SHOW_BUST_EFFECT";
      GameEvent.SWITCH_SCENE = "SWITCH_SCENE";
      GameEvent.DIDED_GUID = "DIDED_GUID";
      GameEvent.AUTO_CLICK = "AUTO_CLICK";
      GameEvent.CLICK = "CLICK";
      GameEvent.BOSS_CREATE = "BOSS_CREATE";
      GameEvent.BOSS_DEATH = "BOSS_DEATH";
      return GameEvent;
    }();
    exports.GameEvent = GameEvent;
    cc._RF.pop();
  }, {} ],
  EventMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "8eb9bHfqxdEaJap0m6XIId2", "EventMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = new cc.EventTarget();
    cc._RF.pop();
  }, {} ],
  ExtendRenderFlow: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "0505c/Nbu5P8IjeRxWqmgkb", "ExtendRenderFlow");
    "use strict";
    var FlagOfset = 0;
    var DONOTHING = 1 << FlagOfset++;
    var BREAK_FLOW = 1 << FlagOfset++;
    var LOCAL_TRANSFORM = 1 << FlagOfset++;
    var WORLD_TRANSFORM = 1 << FlagOfset++;
    var TRANSFORM = LOCAL_TRANSFORM | WORLD_TRANSFORM;
    var UPDATE_RENDER_DATA = 1 << FlagOfset++;
    var OPACITY = 1 << FlagOfset++;
    var COLOR = 1 << FlagOfset++;
    var OPACITY_COLOR = OPACITY | COLOR;
    var RENDER = 1 << FlagOfset++;
    var CHILDREN = 1 << FlagOfset++;
    var POST_RENDER = 1 << FlagOfset++;
    var CHILDREN_BATCH_RENDER = 1 << FlagOfset++;
    var FINAL = 1 << FlagOfset++;
    var _batcher, _forward;
    var _cullingMask = 0;
    function RenderFlow() {
      this._func = init;
      this._next = null;
    }
    var _proto = RenderFlow.prototype;
    _proto._doNothing = function() {};
    _proto._localTransform = function(node) {
      node._updateLocalMatrix();
      node._renderFlag &= ~LOCAL_TRANSFORM;
      this._next._func(node);
    };
    _proto._worldTransform = function(node) {
      _batcher.worldMatDirty++;
      var t = node._matrix;
      var trs = node._trs;
      var tm = t.m;
      tm[12] = trs[0];
      tm[13] = trs[1];
      tm[14] = trs[2];
      node._mulMat(node._worldMatrix, node._parent._worldMatrix, t);
      node._renderFlag &= ~WORLD_TRANSFORM;
      this._next._func(node);
      _batcher.worldMatDirty--;
    };
    _proto._opacity = function(node) {
      _batcher.parentOpacityDirty++;
      node._renderFlag &= ~OPACITY;
      this._next._func(node);
      _batcher.parentOpacityDirty--;
    };
    _proto._color = function(node) {
      var comp = node._renderComponent;
      comp && comp._updateColor();
      node._renderFlag &= ~COLOR;
      this._next._func(node);
    };
    _proto._updateRenderData = function(node) {
      var comp = node._renderComponent;
      comp._assembler.updateRenderData(comp);
      node._renderFlag &= ~UPDATE_RENDER_DATA;
      this._next._func(node);
    };
    _proto._render = function(node) {
      var comp = node._renderComponent;
      comp._checkBacth(_batcher, node._cullingMask);
      comp._assembler.fillBuffers(comp, _batcher);
      this._next._func(node);
    };
    _proto._children = function(node) {
      var cullingMask = _cullingMask;
      var batcher = _batcher;
      var parentOpacity = batcher.parentOpacity;
      var opacity = batcher.parentOpacity *= node._opacity / 255;
      var worldTransformFlag = batcher.worldMatDirty ? WORLD_TRANSFORM : 0;
      var worldOpacityFlag = batcher.parentOpacityDirty ? OPACITY_COLOR : 0;
      var worldDirtyFlag = worldTransformFlag | worldOpacityFlag;
      var children = node._children;
      for (var i = 0, l = children.length; i < l; i++) {
        var c = children[i];
        c._renderFlag |= worldDirtyFlag;
        if (!c._activeInHierarchy || 0 === c._opacity) continue;
        _cullingMask = c._cullingMask = 0 === c.groupIndex ? cullingMask : 1 << c.groupIndex;
        var colorVal = c._color._val;
        c._color._fastSetA(c._opacity * opacity);
        flows[c._renderFlag]._func(c);
        c._color._val = colorVal;
      }
      batcher.parentOpacity = parentOpacity;
      this._next._func(node);
    };
    var childrens = [];
    var cqueue = [];
    var LabelIndex = cc.Enum({
      NONE: 120,
      BITMAP: 100,
      CHAR: 110,
      BMFONT: 200
    });
    var CacheMode = cc.Enum({
      0: "NONE",
      1: "BITMAP",
      2: "CHAR"
    });
    var BMfonts = {};
    var BMfontsNum = 0;
    cc.Layout.prototype.updateLayout = function() {
      if (this._layoutDirty && this.node.children.length > 0) {
        this._doLayout();
        this._layoutDirty = false;
        this._childrenBatchRenderDirty = this.node.children.length + 1;
      }
    };
    function setLocalDirtyFlag(node, flag) {
      node._children && node._children.forEach(function(child) {
        child.setLocalDirty(flag);
        setLocalDirtyFlag(child);
      });
    }
    _proto._childrenBatchRender = function(node) {
      node._renderFlag &= ~CHILDREN;
      node._renderFlag |= CHILDREN_BATCH_RENDER;
      var cullingMask = _cullingMask;
      var batcher = _batcher;
      var parentOpacity = batcher.parentOpacity;
      var opacity = batcher.parentOpacity *= node._opacity / 255;
      var worldTransformFlag = batcher.worldMatDirty ? WORLD_TRANSFORM : 0;
      var worldOpacityFlag = batcher.parentOpacityDirty ? COLOR : 0;
      var worldDirtyFlag = worldTransformFlag | worldOpacityFlag;
      var config = node.config;
      childrens.length = 0;
      cqueue.length = 0;
      Array.prototype.push.apply(cqueue, node._children);
      var ch = null;
      node._batcherOpactity = opacity;
      while (cqueue.length > 0) for (var i = 0, len = cqueue.length; i < len; i++) {
        ch = cqueue.shift();
        if (ch.active) {
          ch._batcherOpactity = ch.parent._batcherOpactity * (ch._opacity / 255);
          ch._color._fastSetA(ch._opacity * ch.parent._batcherOpactity);
          var layout = ch.parent.getComponent(cc.Layout);
          if (layout && layout._childrenBatchRenderDirty > 0) {
            layout._childrenBatchRenderDirty--;
            setLocalDirtyFlag(ch, cc.Node._LocalDirtyFlag.POSITION);
          }
          (ch._localMatDirty & cc.Node._LocalDirtyFlag.SCALE) > 0 && setLocalDirtyFlag(ch, cc.Node._LocalDirtyFlag.SCALE);
          ch._sortIndex = childrens.length;
          childrens.push(ch);
          Array.prototype.push.apply(cqueue, ch._children);
        }
        node._isAnimaing && ch._children.forEach(function(child) {
          child.setLocalDirty(cc.Node._LocalDirtyFlag.ALL);
          child._renderFlag |= RenderFlow.FLAG_OPACITY_COLOR;
        });
      }
      childrens.sort(function(ch1, ch2) {
        function _getRenderIndex(node) {
          var weight = 2e3;
          var name = node._name;
          var index = node._sortIndex;
          if (config[name]) index = config[name] + weight; else {
            var label = node.getComponent(cc.Label);
            if (label) {
              var isttf = true;
              label.font && (isttf = "cc.TTFFont" == cc.js.getClassName(label.font));
              if (label.font && !isttf) if (BMfonts[label.font.name]) index = BMfonts[label.font.name]; else {
                BMfonts[label.font.name] = weight + LabelIndex.BMFONT + BMfontsNum++;
                index = BMfonts[label.font.name];
              } else {
                var cacheMode = label.cacheMode;
                index = LabelIndex[CacheMode[cacheMode]] + weight;
              }
            }
          }
          return index;
        }
        return _getRenderIndex(ch1) - _getRenderIndex(ch2);
      });
      var children = childrens;
      for (var _i = 0, l = children.length; _i < l; _i++) {
        var c = children[_i];
        c.childrenCount > 0 && (c._renderFlag &= ~CHILDREN);
        c._renderFlag |= worldDirtyFlag;
        if (!c._activeInHierarchy || 0 === c._opacity) continue;
        _cullingMask = c._cullingMask = 0 === c.groupIndex ? cullingMask : 1 << c.groupIndex;
        var colorVal = c._color._val;
        flows[c._renderFlag]._func(c);
        c.childrenCount > 0 && (c._renderFlag &= ~CHILDREN);
        c._color._val = colorVal;
      }
      batcher.parentOpacity = parentOpacity;
      this._next._func(node);
    };
    _proto._postRender = function(node) {
      var comp = node._renderComponent;
      comp._checkBacth(_batcher, node._cullingMask);
      comp._assembler.postFillBuffers(comp, _batcher);
      this._next._func(node);
    };
    var EMPTY_FLOW = new RenderFlow();
    EMPTY_FLOW._func = EMPTY_FLOW._doNothing;
    EMPTY_FLOW._next = EMPTY_FLOW;
    var flows = {};
    function createFlow(flag, next) {
      var flow = new RenderFlow();
      flow._next = next || EMPTY_FLOW;
      switch (flag) {
       case DONOTHING:
       case BREAK_FLOW:
        flow._func = flow._doNothing;
        break;

       case LOCAL_TRANSFORM:
        flow._func = flow._localTransform;
        break;

       case WORLD_TRANSFORM:
        flow._func = flow._worldTransform;
        break;

       case OPACITY:
        flow._func = flow._opacity;
        break;

       case COLOR:
        flow._func = flow._color;
        break;

       case UPDATE_RENDER_DATA:
        flow._func = flow._updateRenderData;
        break;

       case RENDER:
        flow._func = flow._render;
        break;

       case CHILDREN:
        flow._func = flow._children;
        break;

       case CHILDREN_BATCH_RENDER:
        flow._func = flow._childrenBatchRender;
        break;

       case POST_RENDER:
        flow._func = flow._postRender;
      }
      return flow;
    }
    function getFlow(flag) {
      var flow = null;
      var tFlag = FINAL;
      while (tFlag > 0) {
        tFlag & flag && (flow = createFlow(tFlag, flow));
        tFlag >>= 1;
      }
      return flow;
    }
    function init(node) {
      var flag = node._renderFlag;
      var r = flows[flag] = getFlow(flag);
      r._func(node);
    }
    RenderFlow.flows = flows;
    RenderFlow.createFlow = createFlow;
    var _validateList = [];
    RenderFlow.registerValidate = function(renderComp) {
      if (renderComp._inValidateList) return;
      _validateList.push(renderComp);
      renderComp._inValidateList = true;
    };
    RenderFlow.validateRenderers = function() {
      for (var i = 0, l = _validateList.length; i < l; i++) {
        var renderComp = _validateList[i];
        if (!renderComp.isValid) continue;
        renderComp.enabledInHierarchy ? renderComp._validateRender() : renderComp.disableRender();
        renderComp._inValidateList = false;
      }
      _validateList.length = 0;
    };
    RenderFlow.visitRootNode = function(rootNode) {
      RenderFlow.validateRenderers();
      _cullingMask = 1 << rootNode.groupIndex;
      if (rootNode._renderFlag & WORLD_TRANSFORM) {
        _batcher.worldMatDirty++;
        rootNode._calculWorldMatrix();
        rootNode._renderFlag &= ~WORLD_TRANSFORM;
        flows[rootNode._renderFlag]._func(rootNode);
        _batcher.worldMatDirty--;
      } else flows[rootNode._renderFlag]._func(rootNode);
    };
    RenderFlow.render = function(scene, dt) {
      _batcher.reset();
      _batcher.walking = true;
      RenderFlow.visitRootNode(scene);
      _batcher.terminate();
      _batcher.walking = false;
      _forward.render(_batcher._renderScene, dt);
    };
    RenderFlow.init = function(batcher, forwardRenderer) {
      _batcher = batcher;
      _forward = forwardRenderer;
      flows[0] = EMPTY_FLOW;
      for (var i = 1; i < FINAL; i++) flows[i] = new RenderFlow();
    };
    RenderFlow.getBachther = function() {
      return _batcher;
    };
    RenderFlow.FLAG_DONOTHING = DONOTHING;
    RenderFlow.FLAG_BREAK_FLOW = BREAK_FLOW;
    RenderFlow.FLAG_LOCAL_TRANSFORM = LOCAL_TRANSFORM;
    RenderFlow.FLAG_WORLD_TRANSFORM = WORLD_TRANSFORM;
    RenderFlow.FLAG_TRANSFORM = TRANSFORM;
    RenderFlow.FLAG_OPACITY = OPACITY;
    RenderFlow.FLAG_COLOR = COLOR;
    RenderFlow.FLAG_OPACITY_COLOR = OPACITY_COLOR;
    RenderFlow.FLAG_UPDATE_RENDER_DATA = UPDATE_RENDER_DATA;
    RenderFlow.FLAG_RENDER = RENDER;
    RenderFlow.FLAG_CHILDREN = CHILDREN;
    RenderFlow.FLAG_CHILDREN_BATCH_RENDER = CHILDREN_BATCH_RENDER;
    RenderFlow.FLAG_POST_RENDER = POST_RENDER;
    RenderFlow.FLAG_FINAL = FINAL;
    if (true, !cc.sys.isNative) {
      cc.RenderFlow.render = RenderFlow.render;
      module.exports = cc.RenderFlow = RenderFlow;
    }
    cc._RF.pop();
  }, {} ],
  FilledSpriteUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d8d38BLNMRNnqfMpW7UiQ/I", "FilledSpriteUtil");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property, executeInEditMode = _a.executeInEditMode, playOnFocus = _a.playOnFocus;
    var FilledSpriteUtil = function(_super) {
      __extends(FilledSpriteUtil, _super);
      function FilledSpriteUtil() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.sprite = null;
        _this.maxRange = 1;
        _this._fillRange = 0;
        return _this;
      }
      Object.defineProperty(FilledSpriteUtil.prototype, "fillRange", {
        get: function() {
          return this._fillRange;
        },
        set: function(value) {
          if (true, this._fillRange == value) return;
          this._fillRange = value;
          this.sprite && (this.sprite.fillRange = this._fillRange * this.maxRange);
        },
        enumerable: true,
        configurable: true
      });
      FilledSpriteUtil.prototype.onLoad = function() {
        this.sprite = this.getComponent(cc.Sprite);
      };
      FilledSpriteUtil.prototype.start = function() {};
      __decorate([ property({
        tooltip: "sprite \u5230\u8fbe\u671f\u671b\u586b\u5145\u65f6\u7684fillRange -1 ~1"
      }) ], FilledSpriteUtil.prototype, "maxRange", void 0);
      __decorate([ property({
        serializable: false
      }) ], FilledSpriteUtil.prototype, "_fillRange", void 0);
      __decorate([ property({
        tooltip: "0~1"
      }) ], FilledSpriteUtil.prototype, "fillRange", null);
      FilledSpriteUtil = __decorate([ ccclass, executeInEditMode, menu("Util/FilledSpriteUtil") ], FilledSpriteUtil);
      return FilledSpriteUtil;
    }(cc.Component);
    exports.default = FilledSpriteUtil;
    cc._RF.pop();
  }, {} ],
  3: [ function(require, module, exports) {
    (function(global, factory) {
      "function" === typeof define && define["amd"] ? define([ "long" ], factory) : "function" === typeof require && "object" === typeof module && module && module["exports"] ? module["exports"] = function() {
        var Long;
        try {
          Long = require("long");
        } catch (e) {}
        return factory(Long);
      }() : (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]);
    })(this, function(Long) {
      "use strict";
      var ByteBuffer = function(capacity, littleEndian, noAssert) {
        "undefined" === typeof capacity && (capacity = ByteBuffer.DEFAULT_CAPACITY);
        "undefined" === typeof littleEndian && (littleEndian = ByteBuffer.DEFAULT_ENDIAN);
        "undefined" === typeof noAssert && (noAssert = ByteBuffer.DEFAULT_NOASSERT);
        if (!noAssert) {
          capacity |= 0;
          if (capacity < 0) throw RangeError("Illegal capacity");
          littleEndian = !!littleEndian;
          noAssert = !!noAssert;
        }
        this.buffer = 0 === capacity ? EMPTY_BUFFER : new ArrayBuffer(capacity);
        this.view = 0 === capacity ? null : new Uint8Array(this.buffer);
        this.offset = 0;
        this.markedOffset = -1;
        this.limit = capacity;
        this.littleEndian = littleEndian;
        this.noAssert = noAssert;
      };
      ByteBuffer.VERSION = "5.0.1";
      ByteBuffer.LITTLE_ENDIAN = true;
      ByteBuffer.BIG_ENDIAN = false;
      ByteBuffer.DEFAULT_CAPACITY = 16;
      ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;
      ByteBuffer.DEFAULT_NOASSERT = false;
      ByteBuffer.Long = Long || null;
      var ByteBufferPrototype = ByteBuffer.prototype;
      ByteBufferPrototype.__isByteBuffer__;
      Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
        value: true,
        enumerable: false,
        configurable: false
      });
      var EMPTY_BUFFER = new ArrayBuffer(0);
      var stringFromCharCode = String.fromCharCode;
      function stringSource(s) {
        var i = 0;
        return function() {
          return i < s.length ? s.charCodeAt(i++) : null;
        };
      }
      function stringDestination() {
        var cs = [], ps = [];
        return function() {
          if (0 === arguments.length) return ps.join("") + stringFromCharCode.apply(String, cs);
          cs.length + arguments.length > 1024 && (ps.push(stringFromCharCode.apply(String, cs)), 
          cs.length = 0);
          Array.prototype.push.apply(cs, arguments);
        };
      }
      ByteBuffer.accessor = function() {
        return Uint8Array;
      };
      ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {
        return new ByteBuffer(capacity, littleEndian, noAssert);
      };
      ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {
        if ("boolean" === typeof encoding || "string" !== typeof encoding) {
          noAssert = littleEndian;
          littleEndian = encoding;
          encoding = void 0;
        }
        var capacity = 0;
        for (var i = 0, k = buffers.length, length; i < k; ++i) {
          ByteBuffer.isByteBuffer(buffers[i]) || (buffers[i] = ByteBuffer.wrap(buffers[i], encoding));
          length = buffers[i].limit - buffers[i].offset;
          length > 0 && (capacity += length);
        }
        if (0 === capacity) return new ByteBuffer(0, littleEndian, noAssert);
        var bb = new ByteBuffer(capacity, littleEndian, noAssert), bi;
        i = 0;
        while (i < k) {
          bi = buffers[i++];
          length = bi.limit - bi.offset;
          if (length <= 0) continue;
          bb.view.set(bi.view.subarray(bi.offset, bi.limit), bb.offset);
          bb.offset += length;
        }
        bb.limit = bb.offset;
        bb.offset = 0;
        return bb;
      };
      ByteBuffer.isByteBuffer = function(bb) {
        return true === (bb && bb["__isByteBuffer__"]);
      };
      ByteBuffer.type = function() {
        return ArrayBuffer;
      };
      ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {
        if ("string" !== typeof encoding) {
          noAssert = littleEndian;
          littleEndian = encoding;
          encoding = void 0;
        }
        if ("string" === typeof buffer) {
          "undefined" === typeof encoding && (encoding = "utf8");
          switch (encoding) {
           case "base64":
            return ByteBuffer.fromBase64(buffer, littleEndian);

           case "hex":
            return ByteBuffer.fromHex(buffer, littleEndian);

           case "binary":
            return ByteBuffer.fromBinary(buffer, littleEndian);

           case "utf8":
            return ByteBuffer.fromUTF8(buffer, littleEndian);

           case "debug":
            return ByteBuffer.fromDebug(buffer, littleEndian);

           default:
            throw Error("Unsupported encoding: " + encoding);
          }
        }
        if (null === buffer || "object" !== typeof buffer) throw TypeError("Illegal buffer");
        var bb;
        if (ByteBuffer.isByteBuffer(buffer)) {
          bb = ByteBufferPrototype.clone.call(buffer);
          bb.markedOffset = -1;
          return bb;
        }
        if (buffer instanceof Uint8Array) {
          bb = new ByteBuffer(0, littleEndian, noAssert);
          if (buffer.length > 0) {
            bb.buffer = buffer.buffer;
            bb.offset = buffer.byteOffset;
            bb.limit = buffer.byteOffset + buffer.byteLength;
            bb.view = new Uint8Array(buffer.buffer);
          }
        } else if (buffer instanceof ArrayBuffer) {
          bb = new ByteBuffer(0, littleEndian, noAssert);
          if (buffer.byteLength > 0) {
            bb.buffer = buffer;
            bb.offset = 0;
            bb.limit = buffer.byteLength;
            bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;
          }
        } else {
          if ("[object Array]" !== Object.prototype.toString.call(buffer)) throw TypeError("Illegal buffer");
          bb = new ByteBuffer(buffer.length, littleEndian, noAssert);
          bb.limit = buffer.length;
          for (var i = 0; i < buffer.length; ++i) bb.view[i] = buffer[i];
        }
        return bb;
      };
      ByteBufferPrototype.writeBitSet = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if (!(value instanceof Array)) throw TypeError("Illegal BitSet: Not an array");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var start = offset, bits = value.length, bytes = bits >> 3, bit = 0, k;
        offset += this.writeVarint32(bits, offset);
        while (bytes--) {
          k = 1 & !!value[bit++] | (1 & !!value[bit++]) << 1 | (1 & !!value[bit++]) << 2 | (1 & !!value[bit++]) << 3 | (1 & !!value[bit++]) << 4 | (1 & !!value[bit++]) << 5 | (1 & !!value[bit++]) << 6 | (1 & !!value[bit++]) << 7;
          this.writeByte(k, offset++);
        }
        if (bit < bits) {
          var m = 0;
          k = 0;
          while (bit < bits) k |= (1 & !!value[bit++]) << m++;
          this.writeByte(k, offset++);
        }
        if (relative) {
          this.offset = offset;
          return this;
        }
        return offset - start;
      };
      ByteBufferPrototype.readBitSet = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        var ret = this.readVarint32(offset), bits = ret.value, bytes = bits >> 3, bit = 0, value = [], k;
        offset += ret.length;
        while (bytes--) {
          k = this.readByte(offset++);
          value[bit++] = !!(1 & k);
          value[bit++] = !!(2 & k);
          value[bit++] = !!(4 & k);
          value[bit++] = !!(8 & k);
          value[bit++] = !!(16 & k);
          value[bit++] = !!(32 & k);
          value[bit++] = !!(64 & k);
          value[bit++] = !!(128 & k);
        }
        if (bit < bits) {
          var m = 0;
          k = this.readByte(offset++);
          while (bit < bits) value[bit++] = !!(k >> m++ & 1);
        }
        relative && (this.offset = offset);
        return value;
      };
      ByteBufferPrototype.readBytes = function(length, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + length > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+" + length + ") <= " + this.buffer.byteLength);
        }
        var slice = this.slice(offset, offset + length);
        relative && (this.offset += length);
        return slice;
      };
      ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;
      ByteBufferPrototype.writeInt8 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value |= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 1;
        var capacity0 = this.buffer.byteLength;
        offset > capacity0 && this.resize((capacity0 *= 2) > offset ? capacity0 : offset);
        offset -= 1;
        this.view[offset] = value;
        relative && (this.offset += 1);
        return this;
      };
      ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;
      ByteBufferPrototype.readInt8 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
        }
        var value = this.view[offset];
        128 === (128 & value) && (value = -(255 - value + 1));
        relative && (this.offset += 1);
        return value;
      };
      ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;
      ByteBufferPrototype.writeUint8 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value >>>= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 1;
        var capacity1 = this.buffer.byteLength;
        offset > capacity1 && this.resize((capacity1 *= 2) > offset ? capacity1 : offset);
        offset -= 1;
        this.view[offset] = value;
        relative && (this.offset += 1);
        return this;
      };
      ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;
      ByteBufferPrototype.readUint8 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
        }
        var value = this.view[offset];
        relative && (this.offset += 1);
        return value;
      };
      ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;
      ByteBufferPrototype.writeInt16 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value |= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 2;
        var capacity2 = this.buffer.byteLength;
        offset > capacity2 && this.resize((capacity2 *= 2) > offset ? capacity2 : offset);
        offset -= 2;
        if (this.littleEndian) {
          this.view[offset + 1] = (65280 & value) >>> 8;
          this.view[offset] = 255 & value;
        } else {
          this.view[offset] = (65280 & value) >>> 8;
          this.view[offset + 1] = 255 & value;
        }
        relative && (this.offset += 2);
        return this;
      };
      ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;
      ByteBufferPrototype.readInt16 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+2) <= " + this.buffer.byteLength);
        }
        var value = 0;
        if (this.littleEndian) {
          value = this.view[offset];
          value |= this.view[offset + 1] << 8;
        } else {
          value = this.view[offset] << 8;
          value |= this.view[offset + 1];
        }
        32768 === (32768 & value) && (value = -(65535 - value + 1));
        relative && (this.offset += 2);
        return value;
      };
      ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;
      ByteBufferPrototype.writeUint16 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value >>>= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 2;
        var capacity3 = this.buffer.byteLength;
        offset > capacity3 && this.resize((capacity3 *= 2) > offset ? capacity3 : offset);
        offset -= 2;
        if (this.littleEndian) {
          this.view[offset + 1] = (65280 & value) >>> 8;
          this.view[offset] = 255 & value;
        } else {
          this.view[offset] = (65280 & value) >>> 8;
          this.view[offset + 1] = 255 & value;
        }
        relative && (this.offset += 2);
        return this;
      };
      ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;
      ByteBufferPrototype.readUint16 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+2) <= " + this.buffer.byteLength);
        }
        var value = 0;
        if (this.littleEndian) {
          value = this.view[offset];
          value |= this.view[offset + 1] << 8;
        } else {
          value = this.view[offset] << 8;
          value |= this.view[offset + 1];
        }
        relative && (this.offset += 2);
        return value;
      };
      ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;
      ByteBufferPrototype.writeInt32 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value |= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 4;
        var capacity4 = this.buffer.byteLength;
        offset > capacity4 && this.resize((capacity4 *= 2) > offset ? capacity4 : offset);
        offset -= 4;
        if (this.littleEndian) {
          this.view[offset + 3] = value >>> 24 & 255;
          this.view[offset + 2] = value >>> 16 & 255;
          this.view[offset + 1] = value >>> 8 & 255;
          this.view[offset] = 255 & value;
        } else {
          this.view[offset] = value >>> 24 & 255;
          this.view[offset + 1] = value >>> 16 & 255;
          this.view[offset + 2] = value >>> 8 & 255;
          this.view[offset + 3] = 255 & value;
        }
        relative && (this.offset += 4);
        return this;
      };
      ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;
      ByteBufferPrototype.readInt32 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.byteLength);
        }
        var value = 0;
        if (this.littleEndian) {
          value = this.view[offset + 2] << 16;
          value |= this.view[offset + 1] << 8;
          value |= this.view[offset];
          value += this.view[offset + 3] << 24 >>> 0;
        } else {
          value = this.view[offset + 1] << 16;
          value |= this.view[offset + 2] << 8;
          value |= this.view[offset + 3];
          value += this.view[offset] << 24 >>> 0;
        }
        value |= 0;
        relative && (this.offset += 4);
        return value;
      };
      ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;
      ByteBufferPrototype.writeUint32 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value >>>= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 4;
        var capacity5 = this.buffer.byteLength;
        offset > capacity5 && this.resize((capacity5 *= 2) > offset ? capacity5 : offset);
        offset -= 4;
        if (this.littleEndian) {
          this.view[offset + 3] = value >>> 24 & 255;
          this.view[offset + 2] = value >>> 16 & 255;
          this.view[offset + 1] = value >>> 8 & 255;
          this.view[offset] = 255 & value;
        } else {
          this.view[offset] = value >>> 24 & 255;
          this.view[offset + 1] = value >>> 16 & 255;
          this.view[offset + 2] = value >>> 8 & 255;
          this.view[offset + 3] = 255 & value;
        }
        relative && (this.offset += 4);
        return this;
      };
      ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;
      ByteBufferPrototype.readUint32 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.byteLength);
        }
        var value = 0;
        if (this.littleEndian) {
          value = this.view[offset + 2] << 16;
          value |= this.view[offset + 1] << 8;
          value |= this.view[offset];
          value += this.view[offset + 3] << 24 >>> 0;
        } else {
          value = this.view[offset + 1] << 16;
          value |= this.view[offset + 2] << 8;
          value |= this.view[offset + 3];
          value += this.view[offset] << 24 >>> 0;
        }
        relative && (this.offset += 4);
        return value;
      };
      ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;
      if (Long) {
        ByteBufferPrototype.writeInt64 = function(value, offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" === typeof value) value = Long.fromNumber(value); else if ("string" === typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)");
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
          }
          "number" === typeof value ? value = Long.fromNumber(value) : "string" === typeof value && (value = Long.fromString(value));
          offset += 8;
          var capacity6 = this.buffer.byteLength;
          offset > capacity6 && this.resize((capacity6 *= 2) > offset ? capacity6 : offset);
          offset -= 8;
          var lo = value.low, hi = value.high;
          if (this.littleEndian) {
            this.view[offset + 3] = lo >>> 24 & 255;
            this.view[offset + 2] = lo >>> 16 & 255;
            this.view[offset + 1] = lo >>> 8 & 255;
            this.view[offset] = 255 & lo;
            offset += 4;
            this.view[offset + 3] = hi >>> 24 & 255;
            this.view[offset + 2] = hi >>> 16 & 255;
            this.view[offset + 1] = hi >>> 8 & 255;
            this.view[offset] = 255 & hi;
          } else {
            this.view[offset] = hi >>> 24 & 255;
            this.view[offset + 1] = hi >>> 16 & 255;
            this.view[offset + 2] = hi >>> 8 & 255;
            this.view[offset + 3] = 255 & hi;
            offset += 4;
            this.view[offset] = lo >>> 24 & 255;
            this.view[offset + 1] = lo >>> 16 & 255;
            this.view[offset + 2] = lo >>> 8 & 255;
            this.view[offset + 3] = 255 & lo;
          }
          relative && (this.offset += 8);
          return this;
        };
        ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;
        ByteBufferPrototype.readInt64 = function(offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.byteLength);
          }
          var lo = 0, hi = 0;
          if (this.littleEndian) {
            lo = this.view[offset + 2] << 16;
            lo |= this.view[offset + 1] << 8;
            lo |= this.view[offset];
            lo += this.view[offset + 3] << 24 >>> 0;
            offset += 4;
            hi = this.view[offset + 2] << 16;
            hi |= this.view[offset + 1] << 8;
            hi |= this.view[offset];
            hi += this.view[offset + 3] << 24 >>> 0;
          } else {
            hi = this.view[offset + 1] << 16;
            hi |= this.view[offset + 2] << 8;
            hi |= this.view[offset + 3];
            hi += this.view[offset] << 24 >>> 0;
            offset += 4;
            lo = this.view[offset + 1] << 16;
            lo |= this.view[offset + 2] << 8;
            lo |= this.view[offset + 3];
            lo += this.view[offset] << 24 >>> 0;
          }
          var value = new Long(lo, hi, false);
          relative && (this.offset += 8);
          return value;
        };
        ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;
        ByteBufferPrototype.writeUint64 = function(value, offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" === typeof value) value = Long.fromNumber(value); else if ("string" === typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)");
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
          }
          "number" === typeof value ? value = Long.fromNumber(value) : "string" === typeof value && (value = Long.fromString(value));
          offset += 8;
          var capacity7 = this.buffer.byteLength;
          offset > capacity7 && this.resize((capacity7 *= 2) > offset ? capacity7 : offset);
          offset -= 8;
          var lo = value.low, hi = value.high;
          if (this.littleEndian) {
            this.view[offset + 3] = lo >>> 24 & 255;
            this.view[offset + 2] = lo >>> 16 & 255;
            this.view[offset + 1] = lo >>> 8 & 255;
            this.view[offset] = 255 & lo;
            offset += 4;
            this.view[offset + 3] = hi >>> 24 & 255;
            this.view[offset + 2] = hi >>> 16 & 255;
            this.view[offset + 1] = hi >>> 8 & 255;
            this.view[offset] = 255 & hi;
          } else {
            this.view[offset] = hi >>> 24 & 255;
            this.view[offset + 1] = hi >>> 16 & 255;
            this.view[offset + 2] = hi >>> 8 & 255;
            this.view[offset + 3] = 255 & hi;
            offset += 4;
            this.view[offset] = lo >>> 24 & 255;
            this.view[offset + 1] = lo >>> 16 & 255;
            this.view[offset + 2] = lo >>> 8 & 255;
            this.view[offset + 3] = 255 & lo;
          }
          relative && (this.offset += 8);
          return this;
        };
        ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;
        ByteBufferPrototype.readUint64 = function(offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.byteLength);
          }
          var lo = 0, hi = 0;
          if (this.littleEndian) {
            lo = this.view[offset + 2] << 16;
            lo |= this.view[offset + 1] << 8;
            lo |= this.view[offset];
            lo += this.view[offset + 3] << 24 >>> 0;
            offset += 4;
            hi = this.view[offset + 2] << 16;
            hi |= this.view[offset + 1] << 8;
            hi |= this.view[offset];
            hi += this.view[offset + 3] << 24 >>> 0;
          } else {
            hi = this.view[offset + 1] << 16;
            hi |= this.view[offset + 2] << 8;
            hi |= this.view[offset + 3];
            hi += this.view[offset] << 24 >>> 0;
            offset += 4;
            lo = this.view[offset + 1] << 16;
            lo |= this.view[offset + 2] << 8;
            lo |= this.view[offset + 3];
            lo += this.view[offset] << 24 >>> 0;
          }
          var value = new Long(lo, hi, true);
          relative && (this.offset += 8);
          return value;
        };
        ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;
      }
      function ieee754_read(buffer, offset, isLE, mLen, nBytes) {
        var e, m, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i = isLE ? nBytes - 1 : 0, d = isLE ? -1 : 1, s = buffer[offset + i];
        i += d;
        e = s & (1 << -nBits) - 1;
        s >>= -nBits;
        nBits += eLen;
        for (;nBits > 0; e = 256 * e + buffer[offset + i], i += d, nBits -= 8) ;
        m = e & (1 << -nBits) - 1;
        e >>= -nBits;
        nBits += mLen;
        for (;nBits > 0; m = 256 * m + buffer[offset + i], i += d, nBits -= 8) ;
        if (0 === e) e = 1 - eBias; else {
          if (e === eMax) return m ? NaN : Infinity * (s ? -1 : 1);
          m += Math.pow(2, mLen);
          e -= eBias;
        }
        return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
      }
      function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) {
        var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 23 === mLen ? Math.pow(2, -24) - Math.pow(2, -77) : 0, i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0;
        value = Math.abs(value);
        if (isNaN(value) || Infinity === value) {
          m = isNaN(value) ? 1 : 0;
          e = eMax;
        } else {
          e = Math.floor(Math.log(value) / Math.LN2);
          if (value * (c = Math.pow(2, -e)) < 1) {
            e--;
            c *= 2;
          }
          value += e + eBias >= 1 ? rt / c : rt * Math.pow(2, 1 - eBias);
          if (value * c >= 2) {
            e++;
            c /= 2;
          }
          if (e + eBias >= eMax) {
            m = 0;
            e = eMax;
          } else if (e + eBias >= 1) {
            m = (value * c - 1) * Math.pow(2, mLen);
            e += eBias;
          } else {
            m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
            e = 0;
          }
        }
        for (;mLen >= 8; buffer[offset + i] = 255 & m, i += d, m /= 256, mLen -= 8) ;
        e = e << mLen | m;
        eLen += mLen;
        for (;eLen > 0; buffer[offset + i] = 255 & e, i += d, e /= 256, eLen -= 8) ;
        buffer[offset + i - d] |= 128 * s;
      }
      ByteBufferPrototype.writeFloat32 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value) throw TypeError("Illegal value: " + value + " (not a number)");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 4;
        var capacity8 = this.buffer.byteLength;
        offset > capacity8 && this.resize((capacity8 *= 2) > offset ? capacity8 : offset);
        offset -= 4;
        ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);
        relative && (this.offset += 4);
        return this;
      };
      ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;
      ByteBufferPrototype.readFloat32 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.byteLength);
        }
        var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);
        relative && (this.offset += 4);
        return value;
      };
      ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;
      ByteBufferPrototype.writeFloat64 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value) throw TypeError("Illegal value: " + value + " (not a number)");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        offset += 8;
        var capacity9 = this.buffer.byteLength;
        offset > capacity9 && this.resize((capacity9 *= 2) > offset ? capacity9 : offset);
        offset -= 8;
        ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);
        relative && (this.offset += 8);
        return this;
      };
      ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;
      ByteBufferPrototype.readFloat64 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+8) <= " + this.buffer.byteLength);
        }
        var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);
        relative && (this.offset += 8);
        return value;
      };
      ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;
      ByteBuffer.MAX_VARINT32_BYTES = 5;
      ByteBuffer.calculateVarint32 = function(value) {
        value >>>= 0;
        return value < 128 ? 1 : value < 16384 ? 2 : value < 1 << 21 ? 3 : value < 1 << 28 ? 4 : 5;
      };
      ByteBuffer.zigZagEncode32 = function(n) {
        return ((n |= 0) << 1 ^ n >> 31) >>> 0;
      };
      ByteBuffer.zigZagDecode32 = function(n) {
        return n >>> 1 ^ -(1 & n) | 0;
      };
      ByteBufferPrototype.writeVarint32 = function(value, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value |= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var size = ByteBuffer.calculateVarint32(value), b;
        offset += size;
        var capacity10 = this.buffer.byteLength;
        offset > capacity10 && this.resize((capacity10 *= 2) > offset ? capacity10 : offset);
        offset -= size;
        value >>>= 0;
        while (value >= 128) {
          b = 127 & value | 128;
          this.view[offset++] = b;
          value >>>= 7;
        }
        this.view[offset++] = value;
        if (relative) {
          this.offset = offset;
          return this;
        }
        return size;
      };
      ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {
        return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);
      };
      ByteBufferPrototype.readVarint32 = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
        }
        var c = 0, value = 0, b;
        do {
          if (!this.noAssert && offset > this.limit) {
            var err = Error("Truncated");
            err["truncated"] = true;
            throw err;
          }
          b = this.view[offset++];
          c < 5 && (value |= (127 & b) << 7 * c);
          ++c;
        } while (0 !== (128 & b));
        value |= 0;
        if (relative) {
          this.offset = offset;
          return value;
        }
        return {
          value: value,
          length: c
        };
      };
      ByteBufferPrototype.readVarint32ZigZag = function(offset) {
        var val = this.readVarint32(offset);
        "object" === typeof val ? val["value"] = ByteBuffer.zigZagDecode32(val["value"]) : val = ByteBuffer.zigZagDecode32(val);
        return val;
      };
      if (Long) {
        ByteBuffer.MAX_VARINT64_BYTES = 10;
        ByteBuffer.calculateVarint64 = function(value) {
          "number" === typeof value ? value = Long.fromNumber(value) : "string" === typeof value && (value = Long.fromString(value));
          var part0 = value.toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
          return 0 == part2 ? 0 == part1 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 1 << 21 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 1 << 21 ? 7 : 8 : part2 < 128 ? 9 : 10;
        };
        ByteBuffer.zigZagEncode64 = function(value) {
          "number" === typeof value ? value = Long.fromNumber(value, false) : "string" === typeof value ? value = Long.fromString(value, false) : false !== value.unsigned && (value = value.toSigned());
          return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
        };
        ByteBuffer.zigZagDecode64 = function(value) {
          "number" === typeof value ? value = Long.fromNumber(value, false) : "string" === typeof value ? value = Long.fromString(value, false) : false !== value.unsigned && (value = value.toSigned());
          return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
        };
        ByteBufferPrototype.writeVarint64 = function(value, offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" === typeof value) value = Long.fromNumber(value); else if ("string" === typeof value) value = Long.fromString(value); else if (!(value && value instanceof Long)) throw TypeError("Illegal value: " + value + " (not an integer or Long)");
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
          }
          "number" === typeof value ? value = Long.fromNumber(value, false) : "string" === typeof value ? value = Long.fromString(value, false) : false !== value.unsigned && (value = value.toSigned());
          var size = ByteBuffer.calculateVarint64(value), part0 = value.toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
          offset += size;
          var capacity11 = this.buffer.byteLength;
          offset > capacity11 && this.resize((capacity11 *= 2) > offset ? capacity11 : offset);
          offset -= size;
          switch (size) {
           case 10:
            this.view[offset + 9] = part2 >>> 7 & 1;

           case 9:
            this.view[offset + 8] = 9 !== size ? 128 | part2 : 127 & part2;

           case 8:
            this.view[offset + 7] = 8 !== size ? part1 >>> 21 | 128 : part1 >>> 21 & 127;

           case 7:
            this.view[offset + 6] = 7 !== size ? part1 >>> 14 | 128 : part1 >>> 14 & 127;

           case 6:
            this.view[offset + 5] = 6 !== size ? part1 >>> 7 | 128 : part1 >>> 7 & 127;

           case 5:
            this.view[offset + 4] = 5 !== size ? 128 | part1 : 127 & part1;

           case 4:
            this.view[offset + 3] = 4 !== size ? part0 >>> 21 | 128 : part0 >>> 21 & 127;

           case 3:
            this.view[offset + 2] = 3 !== size ? part0 >>> 14 | 128 : part0 >>> 14 & 127;

           case 2:
            this.view[offset + 1] = 2 !== size ? part0 >>> 7 | 128 : part0 >>> 7 & 127;

           case 1:
            this.view[offset] = 1 !== size ? 128 | part0 : 127 & part0;
          }
          if (relative) {
            this.offset += size;
            return this;
          }
          return size;
        };
        ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {
          return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);
        };
        ByteBufferPrototype.readVarint64 = function(offset) {
          var relative = "undefined" === typeof offset;
          relative && (offset = this.offset);
          if (!this.noAssert) {
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
          }
          var start = offset, part0 = 0, part1 = 0, part2 = 0, b = 0;
          b = this.view[offset++];
          part0 = 127 & b;
          if (128 & b) {
            b = this.view[offset++];
            part0 |= (127 & b) << 7;
            if (128 & b || this.noAssert && "undefined" === typeof b) {
              b = this.view[offset++];
              part0 |= (127 & b) << 14;
              if (128 & b || this.noAssert && "undefined" === typeof b) {
                b = this.view[offset++];
                part0 |= (127 & b) << 21;
                if (128 & b || this.noAssert && "undefined" === typeof b) {
                  b = this.view[offset++];
                  part1 = 127 & b;
                  if (128 & b || this.noAssert && "undefined" === typeof b) {
                    b = this.view[offset++];
                    part1 |= (127 & b) << 7;
                    if (128 & b || this.noAssert && "undefined" === typeof b) {
                      b = this.view[offset++];
                      part1 |= (127 & b) << 14;
                      if (128 & b || this.noAssert && "undefined" === typeof b) {
                        b = this.view[offset++];
                        part1 |= (127 & b) << 21;
                        if (128 & b || this.noAssert && "undefined" === typeof b) {
                          b = this.view[offset++];
                          part2 = 127 & b;
                          if (128 & b || this.noAssert && "undefined" === typeof b) {
                            b = this.view[offset++];
                            part2 |= (127 & b) << 7;
                            if (128 & b || this.noAssert && "undefined" === typeof b) throw Error("Buffer overrun");
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          var value = Long.fromBits(part0 | part1 << 28, part1 >>> 4 | part2 << 24, false);
          if (relative) {
            this.offset = offset;
            return value;
          }
          return {
            value: value,
            length: offset - start
          };
        };
        ByteBufferPrototype.readVarint64ZigZag = function(offset) {
          var val = this.readVarint64(offset);
          val && val["value"] instanceof Long ? val["value"] = ByteBuffer.zigZagDecode64(val["value"]) : val = ByteBuffer.zigZagDecode64(val);
          return val;
        };
      }
      ByteBufferPrototype.writeCString = function(str, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        var i, k = str.length;
        if (!this.noAssert) {
          if ("string" !== typeof str) throw TypeError("Illegal str: Not a string");
          for (i = 0; i < k; ++i) if (0 === str.charCodeAt(i)) throw RangeError("Illegal str: Contains NULL-characters");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
        offset += k + 1;
        var capacity12 = this.buffer.byteLength;
        offset > capacity12 && this.resize((capacity12 *= 2) > offset ? capacity12 : offset);
        offset -= k + 1;
        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
          this.view[offset++] = b;
        }.bind(this));
        this.view[offset++] = 0;
        if (relative) {
          this.offset = offset;
          return this;
        }
        return k;
      };
      ByteBufferPrototype.readCString = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
        }
        var start = offset, temp;
        var sd, b = -1;
        utfx.decodeUTF8toUTF16(function() {
          if (0 === b) return null;
          if (offset >= this.limit) throw RangeError("Illegal range: Truncated data, " + offset + " < " + this.limit);
          b = this.view[offset++];
          return 0 === b ? null : b;
        }.bind(this), sd = stringDestination(), true);
        if (relative) {
          this.offset = offset;
          return sd();
        }
        return {
          string: sd(),
          length: offset - start
        };
      };
      ByteBufferPrototype.writeIString = function(str, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("string" !== typeof str) throw TypeError("Illegal str: Not a string");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var start = offset, k;
        k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
        offset += 4 + k;
        var capacity13 = this.buffer.byteLength;
        offset > capacity13 && this.resize((capacity13 *= 2) > offset ? capacity13 : offset);
        offset -= 4 + k;
        if (this.littleEndian) {
          this.view[offset + 3] = k >>> 24 & 255;
          this.view[offset + 2] = k >>> 16 & 255;
          this.view[offset + 1] = k >>> 8 & 255;
          this.view[offset] = 255 & k;
        } else {
          this.view[offset] = k >>> 24 & 255;
          this.view[offset + 1] = k >>> 16 & 255;
          this.view[offset + 2] = k >>> 8 & 255;
          this.view[offset + 3] = 255 & k;
        }
        offset += 4;
        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
          this.view[offset++] = b;
        }.bind(this));
        if (offset !== start + 4 + k) throw RangeError("Illegal range: Truncated data, " + offset + " == " + (offset + 4 + k));
        if (relative) {
          this.offset = offset;
          return this;
        }
        return offset - start;
      };
      ByteBufferPrototype.readIString = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+4) <= " + this.buffer.byteLength);
        }
        var start = offset;
        var len = this.readUint32(offset);
        var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);
        offset += str["length"];
        if (relative) {
          this.offset = offset;
          return str["string"];
        }
        return {
          string: str["string"],
          length: offset - start
        };
      };
      ByteBuffer.METRICS_CHARS = "c";
      ByteBuffer.METRICS_BYTES = "b";
      ByteBufferPrototype.writeUTF8String = function(str, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var k;
        var start = offset;
        k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
        offset += k;
        var capacity14 = this.buffer.byteLength;
        offset > capacity14 && this.resize((capacity14 *= 2) > offset ? capacity14 : offset);
        offset -= k;
        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
          this.view[offset++] = b;
        }.bind(this));
        if (relative) {
          this.offset = offset;
          return this;
        }
        return offset - start;
      };
      ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;
      ByteBuffer.calculateUTF8Chars = function(str) {
        return utfx.calculateUTF16asUTF8(stringSource(str))[0];
      };
      ByteBuffer.calculateUTF8Bytes = function(str) {
        return utfx.calculateUTF16asUTF8(stringSource(str))[1];
      };
      ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;
      ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {
        if ("number" === typeof metrics) {
          offset = metrics;
          metrics = void 0;
        }
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        "undefined" === typeof metrics && (metrics = ByteBuffer.METRICS_CHARS);
        if (!this.noAssert) {
          if ("number" !== typeof length || length % 1 !== 0) throw TypeError("Illegal length: " + length + " (not an integer)");
          length |= 0;
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var i = 0, start = offset, sd;
        if (metrics === ByteBuffer.METRICS_CHARS) {
          sd = stringDestination();
          utfx.decodeUTF8(function() {
            return i < length && offset < this.limit ? this.view[offset++] : null;
          }.bind(this), function(cp) {
            ++i;
            utfx.UTF8toUTF16(cp, sd);
          });
          if (i !== length) throw RangeError("Illegal range: Truncated data, " + i + " == " + length);
          if (relative) {
            this.offset = offset;
            return sd();
          }
          return {
            string: sd(),
            length: offset - start
          };
        }
        if (metrics === ByteBuffer.METRICS_BYTES) {
          if (!this.noAssert) {
            if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
            offset >>>= 0;
            if (offset < 0 || offset + length > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+" + length + ") <= " + this.buffer.byteLength);
          }
          var k = offset + length;
          utfx.decodeUTF8toUTF16(function() {
            return offset < k ? this.view[offset++] : null;
          }.bind(this), sd = stringDestination(), this.noAssert);
          if (offset !== k) throw RangeError("Illegal range: Truncated data, " + offset + " == " + k);
          if (relative) {
            this.offset = offset;
            return sd();
          }
          return {
            string: sd(),
            length: offset - start
          };
        }
        throw TypeError("Unsupported metrics: " + metrics);
      };
      ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;
      ByteBufferPrototype.writeVString = function(str, offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("string" !== typeof str) throw TypeError("Illegal str: Not a string");
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        var start = offset, k, l;
        k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
        l = ByteBuffer.calculateVarint32(k);
        offset += l + k;
        var capacity15 = this.buffer.byteLength;
        offset > capacity15 && this.resize((capacity15 *= 2) > offset ? capacity15 : offset);
        offset -= l + k;
        offset += this.writeVarint32(k, offset);
        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
          this.view[offset++] = b;
        }.bind(this));
        if (offset !== start + k + l) throw RangeError("Illegal range: Truncated data, " + offset + " == " + (offset + k + l));
        if (relative) {
          this.offset = offset;
          return this;
        }
        return offset - start;
      };
      ByteBufferPrototype.readVString = function(offset) {
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+1) <= " + this.buffer.byteLength);
        }
        var start = offset;
        var len = this.readVarint32(offset);
        var str = this.readUTF8String(len["value"], ByteBuffer.METRICS_BYTES, offset += len["length"]);
        offset += str["length"];
        if (relative) {
          this.offset = offset;
          return str["string"];
        }
        return {
          string: str["string"],
          length: offset - start
        };
      };
      ByteBufferPrototype.append = function(source, encoding, offset) {
        if ("number" === typeof encoding || "string" !== typeof encoding) {
          offset = encoding;
          encoding = void 0;
        }
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        source instanceof ByteBuffer || (source = ByteBuffer.wrap(source, encoding));
        var length = source.limit - source.offset;
        if (length <= 0) return this;
        offset += length;
        var capacity16 = this.buffer.byteLength;
        offset > capacity16 && this.resize((capacity16 *= 2) > offset ? capacity16 : offset);
        offset -= length;
        this.view.set(source.view.subarray(source.offset, source.limit), offset);
        source.offset += length;
        relative && (this.offset += length);
        return this;
      };
      ByteBufferPrototype.appendTo = function(target, offset) {
        target.append(this, offset);
        return this;
      };
      ByteBufferPrototype.assert = function(assert) {
        this.noAssert = !assert;
        return this;
      };
      ByteBufferPrototype.capacity = function() {
        return this.buffer.byteLength;
      };
      ByteBufferPrototype.clear = function() {
        this.offset = 0;
        this.limit = this.buffer.byteLength;
        this.markedOffset = -1;
        return this;
      };
      ByteBufferPrototype.clone = function(copy) {
        var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);
        if (copy) {
          bb.buffer = new ArrayBuffer(this.buffer.byteLength);
          bb.view = new Uint8Array(bb.buffer);
        } else {
          bb.buffer = this.buffer;
          bb.view = this.view;
        }
        bb.offset = this.offset;
        bb.markedOffset = this.markedOffset;
        bb.limit = this.limit;
        return bb;
      };
      ByteBufferPrototype.compact = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        if (0 === begin && end === this.buffer.byteLength) return this;
        var len = end - begin;
        if (0 === len) {
          this.buffer = EMPTY_BUFFER;
          this.view = null;
          this.markedOffset >= 0 && (this.markedOffset -= begin);
          this.offset = 0;
          this.limit = 0;
          return this;
        }
        var buffer = new ArrayBuffer(len);
        var view = new Uint8Array(buffer);
        view.set(this.view.subarray(begin, end));
        this.buffer = buffer;
        this.view = view;
        this.markedOffset >= 0 && (this.markedOffset -= begin);
        this.offset = 0;
        this.limit = len;
        return this;
      };
      ByteBufferPrototype.copy = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        if (begin === end) return new ByteBuffer(0, this.littleEndian, this.noAssert);
        var capacity = end - begin, bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);
        bb.offset = 0;
        bb.limit = capacity;
        bb.markedOffset >= 0 && (bb.markedOffset -= begin);
        this.copyTo(bb, 0, begin, end);
        return bb;
      };
      ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {
        var relative, targetRelative;
        if (!this.noAssert && !ByteBuffer.isByteBuffer(target)) throw TypeError("Illegal target: Not a ByteBuffer");
        targetOffset = (targetRelative = "undefined" === typeof targetOffset) ? target.offset : 0 | targetOffset;
        sourceOffset = (relative = "undefined" === typeof sourceOffset) ? this.offset : 0 | sourceOffset;
        sourceLimit = "undefined" === typeof sourceLimit ? this.limit : 0 | sourceLimit;
        if (targetOffset < 0 || targetOffset > target.buffer.byteLength) throw RangeError("Illegal target range: 0 <= " + targetOffset + " <= " + target.buffer.byteLength);
        if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength) throw RangeError("Illegal source range: 0 <= " + sourceOffset + " <= " + this.buffer.byteLength);
        var len = sourceLimit - sourceOffset;
        if (0 === len) return target;
        target.ensureCapacity(targetOffset + len);
        target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);
        relative && (this.offset += len);
        targetRelative && (target.offset += len);
        return this;
      };
      ByteBufferPrototype.ensureCapacity = function(capacity) {
        var current = this.buffer.byteLength;
        if (current < capacity) return this.resize((current *= 2) > capacity ? current : capacity);
        return this;
      };
      ByteBufferPrototype.fill = function(value, begin, end) {
        var relative = "undefined" === typeof begin;
        relative && (begin = this.offset);
        "string" === typeof value && value.length > 0 && (value = value.charCodeAt(0));
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof value || value % 1 !== 0) throw TypeError("Illegal value: " + value + " (not an integer)");
          value |= 0;
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        if (begin >= end) return this;
        while (begin < end) this.view[begin++] = value;
        relative && (this.offset = begin);
        return this;
      };
      ByteBufferPrototype.flip = function() {
        this.limit = this.offset;
        this.offset = 0;
        return this;
      };
      ByteBufferPrototype.mark = function(offset) {
        offset = "undefined" === typeof offset ? this.offset : offset;
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        this.markedOffset = offset;
        return this;
      };
      ByteBufferPrototype.order = function(littleEndian) {
        if (!this.noAssert && "boolean" !== typeof littleEndian) throw TypeError("Illegal littleEndian: Not a boolean");
        this.littleEndian = !!littleEndian;
        return this;
      };
      ByteBufferPrototype.LE = function(littleEndian) {
        this.littleEndian = "undefined" === typeof littleEndian || !!littleEndian;
        return this;
      };
      ByteBufferPrototype.BE = function(bigEndian) {
        this.littleEndian = "undefined" !== typeof bigEndian && !bigEndian;
        return this;
      };
      ByteBufferPrototype.prepend = function(source, encoding, offset) {
        if ("number" === typeof encoding || "string" !== typeof encoding) {
          offset = encoding;
          encoding = void 0;
        }
        var relative = "undefined" === typeof offset;
        relative && (offset = this.offset);
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: " + offset + " (not an integer)");
          offset >>>= 0;
          if (offset < 0 || offset + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + offset + " (+0) <= " + this.buffer.byteLength);
        }
        source instanceof ByteBuffer || (source = ByteBuffer.wrap(source, encoding));
        var len = source.limit - source.offset;
        if (len <= 0) return this;
        var diff = len - offset;
        if (diff > 0) {
          var buffer = new ArrayBuffer(this.buffer.byteLength + diff);
          var view = new Uint8Array(buffer);
          view.set(this.view.subarray(offset, this.buffer.byteLength), len);
          this.buffer = buffer;
          this.view = view;
          this.offset += diff;
          this.markedOffset >= 0 && (this.markedOffset += diff);
          this.limit += diff;
          offset += diff;
        } else var arrayView = new Uint8Array(this.buffer);
        this.view.set(source.view.subarray(source.offset, source.limit), offset - len);
        source.offset = source.limit;
        relative && (this.offset -= len);
        return this;
      };
      ByteBufferPrototype.prependTo = function(target, offset) {
        target.prepend(this, offset);
        return this;
      };
      ByteBufferPrototype.printDebug = function(out) {
        "function" !== typeof out && (out = console.log.bind(console));
        out(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(true));
      };
      ByteBufferPrototype.remaining = function() {
        return this.limit - this.offset;
      };
      ByteBufferPrototype.reset = function() {
        if (this.markedOffset >= 0) {
          this.offset = this.markedOffset;
          this.markedOffset = -1;
        } else this.offset = 0;
        return this;
      };
      ByteBufferPrototype.resize = function(capacity) {
        if (!this.noAssert) {
          if ("number" !== typeof capacity || capacity % 1 !== 0) throw TypeError("Illegal capacity: " + capacity + " (not an integer)");
          capacity |= 0;
          if (capacity < 0) throw RangeError("Illegal capacity: 0 <= " + capacity);
        }
        if (this.buffer.byteLength < capacity) {
          var buffer = new ArrayBuffer(capacity);
          var view = new Uint8Array(buffer);
          view.set(this.view);
          this.buffer = buffer;
          this.view = view;
        }
        return this;
      };
      ByteBufferPrototype.reverse = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        if (begin === end) return this;
        Array.prototype.reverse.call(this.view.subarray(begin, end));
        return this;
      };
      ByteBufferPrototype.skip = function(length) {
        if (!this.noAssert) {
          if ("number" !== typeof length || length % 1 !== 0) throw TypeError("Illegal length: " + length + " (not an integer)");
          length |= 0;
        }
        var offset = this.offset + length;
        if (!this.noAssert && (offset < 0 || offset > this.buffer.byteLength)) throw RangeError("Illegal length: 0 <= " + this.offset + " + " + length + " <= " + this.buffer.byteLength);
        this.offset = offset;
        return this;
      };
      ByteBufferPrototype.slice = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        var bb = this.clone();
        bb.offset = begin;
        bb.limit = end;
        return bb;
      };
      ByteBufferPrototype.toBuffer = function(forceCopy) {
        var offset = this.offset, limit = this.limit;
        if (!this.noAssert) {
          if ("number" !== typeof offset || offset % 1 !== 0) throw TypeError("Illegal offset: Not an integer");
          offset >>>= 0;
          if ("number" !== typeof limit || limit % 1 !== 0) throw TypeError("Illegal limit: Not an integer");
          limit >>>= 0;
          if (offset < 0 || offset > limit || limit > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + offset + " <= " + limit + " <= " + this.buffer.byteLength);
        }
        if (!forceCopy && 0 === offset && limit === this.buffer.byteLength) return this.buffer;
        if (offset === limit) return EMPTY_BUFFER;
        var buffer = new ArrayBuffer(limit - offset);
        new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);
        return buffer;
      };
      ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;
      ByteBufferPrototype.toString = function(encoding, begin, end) {
        if ("undefined" === typeof encoding) return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
        "number" === typeof encoding && (encoding = "utf8", begin = encoding, end = begin);
        switch (encoding) {
         case "utf8":
          return this.toUTF8(begin, end);

         case "base64":
          return this.toBase64(begin, end);

         case "hex":
          return this.toHex(begin, end);

         case "binary":
          return this.toBinary(begin, end);

         case "debug":
          return this.toDebug();

         case "columns":
          return this.toColumns();

         default:
          throw Error("Unsupported encoding: " + encoding);
        }
      };
      var lxiv = function() {
        var lxiv = {};
        var aout = [ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 ];
        var ain = [];
        for (var i = 0, k = aout.length; i < k; ++i) ain[aout[i]] = i;
        lxiv.encode = function(src, dst) {
          var b, t;
          while (null !== (b = src())) {
            dst(aout[b >> 2 & 63]);
            t = (3 & b) << 4;
            if (null !== (b = src())) {
              t |= b >> 4 & 15;
              dst(aout[63 & (t | b >> 4 & 15)]);
              t = (15 & b) << 2;
              null !== (b = src()) ? (dst(aout[63 & (t | b >> 6 & 3)]), dst(aout[63 & b])) : (dst(aout[63 & t]), 
              dst(61));
            } else dst(aout[63 & t]), dst(61), dst(61);
          }
        };
        lxiv.decode = function(src, dst) {
          var c, t1, t2;
          function fail(c) {
            throw Error("Illegal character code: " + c);
          }
          while (null !== (c = src())) {
            t1 = ain[c];
            "undefined" === typeof t1 && fail(c);
            if (null !== (c = src())) {
              t2 = ain[c];
              "undefined" === typeof t2 && fail(c);
              dst(t1 << 2 >>> 0 | (48 & t2) >> 4);
              if (null !== (c = src())) {
                t1 = ain[c];
                if ("undefined" === typeof t1) {
                  if (61 === c) break;
                  fail(c);
                }
                dst((15 & t2) << 4 >>> 0 | (60 & t1) >> 2);
                if (null !== (c = src())) {
                  t2 = ain[c];
                  if ("undefined" === typeof t2) {
                    if (61 === c) break;
                    fail(c);
                  }
                  dst((3 & t1) << 6 >>> 0 | t2);
                }
              }
            }
          }
        };
        lxiv.test = function(str) {
          return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);
        };
        return lxiv;
      }();
      ByteBufferPrototype.toBase64 = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        begin |= 0;
        end |= 0;
        if (begin < 0 || end > this.capacity || begin > end) throw RangeError("begin, end");
        var sd;
        lxiv.encode(function() {
          return begin < end ? this.view[begin++] : null;
        }.bind(this), sd = stringDestination());
        return sd();
      };
      ByteBuffer.fromBase64 = function(str, littleEndian) {
        if ("string" !== typeof str) throw TypeError("str");
        var bb = new ByteBuffer(str.length / 4 * 3, littleEndian), i = 0;
        lxiv.decode(stringSource(str), function(b) {
          bb.view[i++] = b;
        });
        bb.limit = i;
        return bb;
      };
      ByteBuffer.btoa = function(str) {
        return ByteBuffer.fromBinary(str).toBase64();
      };
      ByteBuffer.atob = function(b64) {
        return ByteBuffer.fromBase64(b64).toBinary();
      };
      ByteBufferPrototype.toBinary = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        begin |= 0;
        end |= 0;
        if (begin < 0 || end > this.capacity() || begin > end) throw RangeError("begin, end");
        if (begin === end) return "";
        var chars = [], parts = [];
        while (begin < end) {
          chars.push(this.view[begin++]);
          chars.length >= 1024 && (parts.push(String.fromCharCode.apply(String, chars)), chars = []);
        }
        return parts.join("") + String.fromCharCode.apply(String, chars);
      };
      ByteBuffer.fromBinary = function(str, littleEndian) {
        if ("string" !== typeof str) throw TypeError("str");
        var i = 0, k = str.length, charCode, bb = new ByteBuffer(k, littleEndian);
        while (i < k) {
          charCode = str.charCodeAt(i);
          if (charCode > 255) throw RangeError("illegal char code: " + charCode);
          bb.view[i++] = charCode;
        }
        bb.limit = k;
        return bb;
      };
      ByteBufferPrototype.toDebug = function(columns) {
        var i = -1, k = this.buffer.byteLength, b, hex = "", asc = "", out = "";
        while (i < k) {
          if (-1 !== i) {
            b = this.view[i];
            hex += b < 16 ? "0" + b.toString(16).toUpperCase() : b.toString(16).toUpperCase();
            columns && (asc += b > 32 && b < 127 ? String.fromCharCode(b) : ".");
          }
          ++i;
          if (columns && i > 0 && i % 16 === 0 && i !== k) {
            while (hex.length < 51) hex += " ";
            out += hex + asc + "\n";
            hex = asc = "";
          }
          i === this.offset && i === this.limit ? hex += i === this.markedOffset ? "!" : "|" : i === this.offset ? hex += i === this.markedOffset ? "[" : "<" : i === this.limit ? hex += i === this.markedOffset ? "]" : ">" : hex += i === this.markedOffset ? "'" : columns || 0 !== i && i !== k ? " " : "";
        }
        if (columns && " " !== hex) {
          while (hex.length < 51) hex += " ";
          out += hex + asc + "\n";
        }
        return columns ? out : hex;
      };
      ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {
        var k = str.length, bb = new ByteBuffer((k + 1) / 3 | 0, littleEndian, noAssert);
        var i = 0, j = 0, ch, b, rs = false, ho = false, hm = false, hl = false, fail = false;
        while (i < k) {
          switch (ch = str.charAt(i++)) {
           case "!":
            if (!noAssert) {
              if (ho || hm || hl) {
                fail = true;
                break;
              }
              ho = hm = hl = true;
            }
            bb.offset = bb.markedOffset = bb.limit = j;
            rs = false;
            break;

           case "|":
            if (!noAssert) {
              if (ho || hl) {
                fail = true;
                break;
              }
              ho = hl = true;
            }
            bb.offset = bb.limit = j;
            rs = false;
            break;

           case "[":
            if (!noAssert) {
              if (ho || hm) {
                fail = true;
                break;
              }
              ho = hm = true;
            }
            bb.offset = bb.markedOffset = j;
            rs = false;
            break;

           case "<":
            if (!noAssert) {
              if (ho) {
                fail = true;
                break;
              }
              ho = true;
            }
            bb.offset = j;
            rs = false;
            break;

           case "]":
            if (!noAssert) {
              if (hl || hm) {
                fail = true;
                break;
              }
              hl = hm = true;
            }
            bb.limit = bb.markedOffset = j;
            rs = false;
            break;

           case ">":
            if (!noAssert) {
              if (hl) {
                fail = true;
                break;
              }
              hl = true;
            }
            bb.limit = j;
            rs = false;
            break;

           case "'":
            if (!noAssert) {
              if (hm) {
                fail = true;
                break;
              }
              hm = true;
            }
            bb.markedOffset = j;
            rs = false;
            break;

           case " ":
            rs = false;
            break;

           default:
            if (!noAssert && rs) {
              fail = true;
              break;
            }
            b = parseInt(ch + str.charAt(i++), 16);
            if (!noAssert && (isNaN(b) || b < 0 || b > 255)) throw TypeError("Illegal str: Not a debug encoded string");
            bb.view[j++] = b;
            rs = true;
          }
          if (fail) throw TypeError("Illegal str: Invalid symbol at " + i);
        }
        if (!noAssert) {
          if (!ho || !hl) throw TypeError("Illegal str: Missing offset or limit");
          if (j < bb.buffer.byteLength) throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + j + " < " + k);
        }
        return bb;
      };
      ByteBufferPrototype.toHex = function(begin, end) {
        begin = "undefined" === typeof begin ? this.offset : begin;
        end = "undefined" === typeof end ? this.limit : end;
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        var out = new Array(end - begin), b;
        while (begin < end) {
          b = this.view[begin++];
          b < 16 ? out.push("0", b.toString(16)) : out.push(b.toString(16));
        }
        return out.join("");
      };
      ByteBuffer.fromHex = function(str, littleEndian, noAssert) {
        if (!noAssert) {
          if ("string" !== typeof str) throw TypeError("Illegal str: Not a string");
          if (str.length % 2 !== 0) throw TypeError("Illegal str: Length not a multiple of 2");
        }
        var k = str.length, bb = new ByteBuffer(k / 2 | 0, littleEndian), b;
        for (var i = 0, j = 0; i < k; i += 2) {
          b = parseInt(str.substring(i, i + 2), 16);
          if (!noAssert && (!isFinite(b) || b < 0 || b > 255)) throw TypeError("Illegal str: Contains non-hex characters");
          bb.view[j++] = b;
        }
        bb.limit = j;
        return bb;
      };
      var utfx = function() {
        var utfx = {};
        utfx.MAX_CODEPOINT = 1114111;
        utfx.encodeUTF8 = function(src, dst) {
          var cp = null;
          "number" === typeof src && (cp = src, src = function() {
            return null;
          });
          while (null !== cp || null !== (cp = src())) {
            cp < 128 ? dst(127 & cp) : cp < 2048 ? (dst(cp >> 6 & 31 | 192), dst(63 & cp | 128)) : cp < 65536 ? (dst(cp >> 12 & 15 | 224), 
            dst(cp >> 6 & 63 | 128), dst(63 & cp | 128)) : (dst(cp >> 18 & 7 | 240), dst(cp >> 12 & 63 | 128), 
            dst(cp >> 6 & 63 | 128), dst(63 & cp | 128));
            cp = null;
          }
        };
        utfx.decodeUTF8 = function(src, dst) {
          var a, b, c, d, fail = function(b) {
            b = b.slice(0, b.indexOf(null));
            var err = Error(b.toString());
            err.name = "TruncatedError";
            err["bytes"] = b;
            throw err;
          };
          while (null !== (a = src())) if (0 === (128 & a)) dst(a); else if (192 === (224 & a)) null === (b = src()) && fail([ a, b ]), 
          dst((31 & a) << 6 | 63 & b); else if (224 === (240 & a)) (null === (b = src()) || null === (c = src())) && fail([ a, b, c ]), 
          dst((15 & a) << 12 | (63 & b) << 6 | 63 & c); else {
            if (240 !== (248 & a)) throw RangeError("Illegal starting byte: " + a);
            (null === (b = src()) || null === (c = src()) || null === (d = src())) && fail([ a, b, c, d ]), 
            dst((7 & a) << 18 | (63 & b) << 12 | (63 & c) << 6 | 63 & d);
          }
        };
        utfx.UTF16toUTF8 = function(src, dst) {
          var c1, c2 = null;
          while (true) {
            if (null === (c1 = null !== c2 ? c2 : src())) break;
            if (c1 >= 55296 && c1 <= 57343 && null !== (c2 = src()) && c2 >= 56320 && c2 <= 57343) {
              dst(1024 * (c1 - 55296) + c2 - 56320 + 65536);
              c2 = null;
              continue;
            }
            dst(c1);
          }
          null !== c2 && dst(c2);
        };
        utfx.UTF8toUTF16 = function(src, dst) {
          var cp = null;
          "number" === typeof src && (cp = src, src = function() {
            return null;
          });
          while (null !== cp || null !== (cp = src())) {
            cp <= 65535 ? dst(cp) : (cp -= 65536, dst(55296 + (cp >> 10)), dst(cp % 1024 + 56320));
            cp = null;
          }
        };
        utfx.encodeUTF16toUTF8 = function(src, dst) {
          utfx.UTF16toUTF8(src, function(cp) {
            utfx.encodeUTF8(cp, dst);
          });
        };
        utfx.decodeUTF8toUTF16 = function(src, dst) {
          utfx.decodeUTF8(src, function(cp) {
            utfx.UTF8toUTF16(cp, dst);
          });
        };
        utfx.calculateCodePoint = function(cp) {
          return cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4;
        };
        utfx.calculateUTF8 = function(src) {
          var cp, l = 0;
          while (null !== (cp = src())) l += cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4;
          return l;
        };
        utfx.calculateUTF16asUTF8 = function(src) {
          var n = 0, l = 0;
          utfx.UTF16toUTF8(src, function(cp) {
            ++n;
            l += cp < 128 ? 1 : cp < 2048 ? 2 : cp < 65536 ? 3 : 4;
          });
          return [ n, l ];
        };
        return utfx;
      }();
      ByteBufferPrototype.toUTF8 = function(begin, end) {
        "undefined" === typeof begin && (begin = this.offset);
        "undefined" === typeof end && (end = this.limit);
        if (!this.noAssert) {
          if ("number" !== typeof begin || begin % 1 !== 0) throw TypeError("Illegal begin: Not an integer");
          begin >>>= 0;
          if ("number" !== typeof end || end % 1 !== 0) throw TypeError("Illegal end: Not an integer");
          end >>>= 0;
          if (begin < 0 || begin > end || end > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + begin + " <= " + end + " <= " + this.buffer.byteLength);
        }
        var sd;
        try {
          utfx.decodeUTF8toUTF16(function() {
            return begin < end ? this.view[begin++] : null;
          }.bind(this), sd = stringDestination());
        } catch (e) {
          if (begin !== end) throw RangeError("Illegal range: Truncated data, " + begin + " != " + end);
        }
        return sd();
      };
      ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {
        if (!noAssert && "string" !== typeof str) throw TypeError("Illegal str: Not a string");
        var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert), i = 0;
        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
          bb.view[i++] = b;
        });
        bb.limit = i;
        return bb;
      };
      return ByteBuffer;
    });
  }, {
    long: 4
  } ],
  4: [ function(require, module, exports) {
    (function(global, factory) {
      "function" === typeof define && define["amd"] ? define([], factory) : "function" === typeof require && "object" === typeof module && module && module["exports"] ? module["exports"] = factory() : (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory();
    })(this, function() {
      "use strict";
      function Long(low, high, unsigned) {
        this.low = 0 | low;
        this.high = 0 | high;
        this.unsigned = !!unsigned;
      }
      Long.prototype.__isLong__;
      Object.defineProperty(Long.prototype, "__isLong__", {
        value: true,
        enumerable: false,
        configurable: false
      });
      function isLong(obj) {
        return true === (obj && obj["__isLong__"]);
      }
      Long.isLong = isLong;
      var INT_CACHE = {};
      var UINT_CACHE = {};
      function fromInt(value, unsigned) {
        var obj, cachedObj, cache;
        if (unsigned) {
          value >>>= 0;
          if (cache = 0 <= value && value < 256) {
            cachedObj = UINT_CACHE[value];
            if (cachedObj) return cachedObj;
          }
          obj = fromBits(value, (0 | value) < 0 ? -1 : 0, true);
          cache && (UINT_CACHE[value] = obj);
          return obj;
        }
        value |= 0;
        if (cache = -128 <= value && value < 128) {
          cachedObj = INT_CACHE[value];
          if (cachedObj) return cachedObj;
        }
        obj = fromBits(value, value < 0 ? -1 : 0, false);
        cache && (INT_CACHE[value] = obj);
        return obj;
      }
      Long.fromInt = fromInt;
      function fromNumber(value, unsigned) {
        if (isNaN(value) || !isFinite(value)) return unsigned ? UZERO : ZERO;
        if (unsigned) {
          if (value < 0) return UZERO;
          if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;
        } else {
          if (value <= -TWO_PWR_63_DBL) return MIN_VALUE;
          if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;
        }
        if (value < 0) return fromNumber(-value, unsigned).neg();
        return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned);
      }
      Long.fromNumber = fromNumber;
      function fromBits(lowBits, highBits, unsigned) {
        return new Long(lowBits, highBits, unsigned);
      }
      Long.fromBits = fromBits;
      var pow_dbl = Math.pow;
      function fromString(str, unsigned, radix) {
        if (0 === str.length) throw Error("empty string");
        if ("NaN" === str || "Infinity" === str || "+Infinity" === str || "-Infinity" === str) return ZERO;
        "number" === typeof unsigned ? (radix = unsigned, unsigned = false) : unsigned = !!unsigned;
        radix = radix || 10;
        if (radix < 2 || 36 < radix) throw RangeError("radix");
        var p;
        if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen");
        if (0 === p) return fromString(str.substring(1), unsigned, radix).neg();
        var radixToPower = fromNumber(pow_dbl(radix, 8));
        var result = ZERO;
        for (var i = 0; i < str.length; i += 8) {
          var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);
          if (size < 8) {
            var power = fromNumber(pow_dbl(radix, size));
            result = result.mul(power).add(fromNumber(value));
          } else {
            result = result.mul(radixToPower);
            result = result.add(fromNumber(value));
          }
        }
        result.unsigned = unsigned;
        return result;
      }
      Long.fromString = fromString;
      function fromValue(val) {
        if (val instanceof Long) return val;
        if ("number" === typeof val) return fromNumber(val);
        if ("string" === typeof val) return fromString(val);
        return fromBits(val.low, val.high, val.unsigned);
      }
      Long.fromValue = fromValue;
      var TWO_PWR_16_DBL = 65536;
      var TWO_PWR_24_DBL = 1 << 24;
      var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
      var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
      var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
      var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
      var ZERO = fromInt(0);
      Long.ZERO = ZERO;
      var UZERO = fromInt(0, true);
      Long.UZERO = UZERO;
      var ONE = fromInt(1);
      Long.ONE = ONE;
      var UONE = fromInt(1, true);
      Long.UONE = UONE;
      var NEG_ONE = fromInt(-1);
      Long.NEG_ONE = NEG_ONE;
      var MAX_VALUE = fromBits(-1, 2147483647, false);
      Long.MAX_VALUE = MAX_VALUE;
      var MAX_UNSIGNED_VALUE = fromBits(-1, -1, true);
      Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
      var MIN_VALUE = fromBits(0, -2147483648, false);
      Long.MIN_VALUE = MIN_VALUE;
      var LongPrototype = Long.prototype;
      LongPrototype.toInt = function toInt() {
        return this.unsigned ? this.low >>> 0 : this.low;
      };
      LongPrototype.toNumber = function toNumber() {
        if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);
        return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
      };
      LongPrototype.toString = function toString(radix) {
        radix = radix || 10;
        if (radix < 2 || 36 < radix) throw RangeError("radix");
        if (this.isZero()) return "0";
        if (this.isNegative()) {
          if (this.eq(MIN_VALUE)) {
            var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this);
            return div.toString(radix) + rem1.toInt().toString(radix);
          }
          return "-" + this.neg().toString(radix);
        }
        var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this;
        var result = "";
        while (true) {
          var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix);
          rem = remDiv;
          if (rem.isZero()) return digits + result;
          while (digits.length < 6) digits = "0" + digits;
          result = "" + digits + result;
        }
      };
      LongPrototype.getHighBits = function getHighBits() {
        return this.high;
      };
      LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
        return this.high >>> 0;
      };
      LongPrototype.getLowBits = function getLowBits() {
        return this.low;
      };
      LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
        return this.low >>> 0;
      };
      LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
        if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
        var val = 0 != this.high ? this.high : this.low;
        for (var bit = 31; bit > 0; bit--) if (0 != (val & 1 << bit)) break;
        return 0 != this.high ? bit + 33 : bit + 1;
      };
      LongPrototype.isZero = function isZero() {
        return 0 === this.high && 0 === this.low;
      };
      LongPrototype.isNegative = function isNegative() {
        return !this.unsigned && this.high < 0;
      };
      LongPrototype.isPositive = function isPositive() {
        return this.unsigned || this.high >= 0;
      };
      LongPrototype.isOdd = function isOdd() {
        return 1 === (1 & this.low);
      };
      LongPrototype.isEven = function isEven() {
        return 0 === (1 & this.low);
      };
      LongPrototype.equals = function equals(other) {
        isLong(other) || (other = fromValue(other));
        if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false;
        return this.high === other.high && this.low === other.low;
      };
      LongPrototype.eq = LongPrototype.equals;
      LongPrototype.notEquals = function notEquals(other) {
        return !this.eq(other);
      };
      LongPrototype.neq = LongPrototype.notEquals;
      LongPrototype.lessThan = function lessThan(other) {
        return this.comp(other) < 0;
      };
      LongPrototype.lt = LongPrototype.lessThan;
      LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
        return this.comp(other) <= 0;
      };
      LongPrototype.lte = LongPrototype.lessThanOrEqual;
      LongPrototype.greaterThan = function greaterThan(other) {
        return this.comp(other) > 0;
      };
      LongPrototype.gt = LongPrototype.greaterThan;
      LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
        return this.comp(other) >= 0;
      };
      LongPrototype.gte = LongPrototype.greaterThanOrEqual;
      LongPrototype.compare = function compare(other) {
        isLong(other) || (other = fromValue(other));
        if (this.eq(other)) return 0;
        var thisNeg = this.isNegative(), otherNeg = other.isNegative();
        if (thisNeg && !otherNeg) return -1;
        if (!thisNeg && otherNeg) return 1;
        if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1;
        return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1;
      };
      LongPrototype.comp = LongPrototype.compare;
      LongPrototype.negate = function negate() {
        if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE;
        return this.not().add(ONE);
      };
      LongPrototype.neg = LongPrototype.negate;
      LongPrototype.add = function add(addend) {
        isLong(addend) || (addend = fromValue(addend));
        var a48 = this.high >>> 16;
        var a32 = 65535 & this.high;
        var a16 = this.low >>> 16;
        var a00 = 65535 & this.low;
        var b48 = addend.high >>> 16;
        var b32 = 65535 & addend.high;
        var b16 = addend.low >>> 16;
        var b00 = 65535 & addend.low;
        var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
        c00 += a00 + b00;
        c16 += c00 >>> 16;
        c00 &= 65535;
        c16 += a16 + b16;
        c32 += c16 >>> 16;
        c16 &= 65535;
        c32 += a32 + b32;
        c48 += c32 >>> 16;
        c32 &= 65535;
        c48 += a48 + b48;
        c48 &= 65535;
        return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
      };
      LongPrototype.subtract = function subtract(subtrahend) {
        isLong(subtrahend) || (subtrahend = fromValue(subtrahend));
        return this.add(subtrahend.neg());
      };
      LongPrototype.sub = LongPrototype.subtract;
      LongPrototype.multiply = function multiply(multiplier) {
        if (this.isZero()) return ZERO;
        isLong(multiplier) || (multiplier = fromValue(multiplier));
        if (multiplier.isZero()) return ZERO;
        if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO;
        if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO;
        if (this.isNegative()) return multiplier.isNegative() ? this.neg().mul(multiplier.neg()) : this.neg().mul(multiplier).neg();
        if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg();
        if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
        var a48 = this.high >>> 16;
        var a32 = 65535 & this.high;
        var a16 = this.low >>> 16;
        var a00 = 65535 & this.low;
        var b48 = multiplier.high >>> 16;
        var b32 = 65535 & multiplier.high;
        var b16 = multiplier.low >>> 16;
        var b00 = 65535 & multiplier.low;
        var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
        c00 += a00 * b00;
        c16 += c00 >>> 16;
        c00 &= 65535;
        c16 += a16 * b00;
        c32 += c16 >>> 16;
        c16 &= 65535;
        c16 += a00 * b16;
        c32 += c16 >>> 16;
        c16 &= 65535;
        c32 += a32 * b00;
        c48 += c32 >>> 16;
        c32 &= 65535;
        c32 += a16 * b16;
        c48 += c32 >>> 16;
        c32 &= 65535;
        c32 += a00 * b32;
        c48 += c32 >>> 16;
        c32 &= 65535;
        c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
        c48 &= 65535;
        return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
      };
      LongPrototype.mul = LongPrototype.multiply;
      LongPrototype.divide = function divide(divisor) {
        isLong(divisor) || (divisor = fromValue(divisor));
        if (divisor.isZero()) throw Error("division by zero");
        if (this.isZero()) return this.unsigned ? UZERO : ZERO;
        var approx, rem, res;
        if (this.unsigned) {
          divisor.unsigned || (divisor = divisor.toUnsigned());
          if (divisor.gt(this)) return UZERO;
          if (divisor.gt(this.shru(1))) return UONE;
          res = UZERO;
        } else {
          if (this.eq(MIN_VALUE)) {
            if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE;
            if (divisor.eq(MIN_VALUE)) return ONE;
            var halfThis = this.shr(1);
            approx = halfThis.div(divisor).shl(1);
            if (approx.eq(ZERO)) return divisor.isNegative() ? ONE : NEG_ONE;
            rem = this.sub(divisor.mul(approx));
            res = approx.add(rem.div(divisor));
            return res;
          }
          if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO;
          if (this.isNegative()) {
            if (divisor.isNegative()) return this.neg().div(divisor.neg());
            return this.neg().div(divisor).neg();
          }
          if (divisor.isNegative()) return this.div(divisor.neg()).neg();
          res = ZERO;
        }
        rem = this;
        while (rem.gte(divisor)) {
          approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
          var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor);
          while (approxRem.isNegative() || approxRem.gt(rem)) {
            approx -= delta;
            approxRes = fromNumber(approx, this.unsigned);
            approxRem = approxRes.mul(divisor);
          }
          approxRes.isZero() && (approxRes = ONE);
          res = res.add(approxRes);
          rem = rem.sub(approxRem);
        }
        return res;
      };
      LongPrototype.div = LongPrototype.divide;
      LongPrototype.modulo = function modulo(divisor) {
        isLong(divisor) || (divisor = fromValue(divisor));
        return this.sub(this.div(divisor).mul(divisor));
      };
      LongPrototype.mod = LongPrototype.modulo;
      LongPrototype.not = function not() {
        return fromBits(~this.low, ~this.high, this.unsigned);
      };
      LongPrototype.and = function and(other) {
        isLong(other) || (other = fromValue(other));
        return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
      };
      LongPrototype.or = function or(other) {
        isLong(other) || (other = fromValue(other));
        return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
      };
      LongPrototype.xor = function xor(other) {
        isLong(other) || (other = fromValue(other));
        return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
      };
      LongPrototype.shiftLeft = function shiftLeft(numBits) {
        isLong(numBits) && (numBits = numBits.toInt());
        return 0 === (numBits &= 63) ? this : numBits < 32 ? fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned) : fromBits(0, this.low << numBits - 32, this.unsigned);
      };
      LongPrototype.shl = LongPrototype.shiftLeft;
      LongPrototype.shiftRight = function shiftRight(numBits) {
        isLong(numBits) && (numBits = numBits.toInt());
        return 0 === (numBits &= 63) ? this : numBits < 32 ? fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned) : fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned);
      };
      LongPrototype.shr = LongPrototype.shiftRight;
      LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
        isLong(numBits) && (numBits = numBits.toInt());
        numBits &= 63;
        if (0 === numBits) return this;
        var high = this.high;
        if (numBits < 32) {
          var low = this.low;
          return fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned);
        }
        return fromBits(32 === numBits ? high : high >>> numBits - 32, 0, this.unsigned);
      };
      LongPrototype.shru = LongPrototype.shiftRightUnsigned;
      LongPrototype.toSigned = function toSigned() {
        if (!this.unsigned) return this;
        return fromBits(this.low, this.high, false);
      };
      LongPrototype.toUnsigned = function toUnsigned() {
        if (this.unsigned) return this;
        return fromBits(this.low, this.high, true);
      };
      LongPrototype.toBytes = function(le) {
        return le ? this.toBytesLE() : this.toBytesBE();
      };
      LongPrototype.toBytesLE = function() {
        var hi = this.high, lo = this.low;
        return [ 255 & lo, lo >>> 8 & 255, lo >>> 16 & 255, lo >>> 24 & 255, 255 & hi, hi >>> 8 & 255, hi >>> 16 & 255, hi >>> 24 & 255 ];
      };
      LongPrototype.toBytesBE = function() {
        var hi = this.high, lo = this.low;
        return [ hi >>> 24 & 255, hi >>> 16 & 255, hi >>> 8 & 255, 255 & hi, lo >>> 24 & 255, lo >>> 16 & 255, lo >>> 8 & 255, 255 & lo ];
      };
      return Long;
    });
  }, {} ],
  5: [ function(require, module, exports) {
    (function(process) {
      (function(global, factory) {
        "function" === typeof define && define["amd"] ? define([ "bytebuffer" ], factory) : "function" === typeof require && "object" === typeof module && module && module["exports"] ? module["exports"] = factory(require("bytebuffer"), true) : (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);
      })(this, function(ByteBuffer, isCommonJS) {
        "use strict";
        var ProtoBuf = {};
        ProtoBuf.ByteBuffer = ByteBuffer;
        ProtoBuf.Long = ByteBuffer.Long || null;
        ProtoBuf.VERSION = "5.0.3";
        ProtoBuf.WIRE_TYPES = {};
        ProtoBuf.WIRE_TYPES.VARINT = 0;
        ProtoBuf.WIRE_TYPES.BITS64 = 1;
        ProtoBuf.WIRE_TYPES.LDELIM = 2;
        ProtoBuf.WIRE_TYPES.STARTGROUP = 3;
        ProtoBuf.WIRE_TYPES.ENDGROUP = 4;
        ProtoBuf.WIRE_TYPES.BITS32 = 5;
        ProtoBuf.PACKABLE_WIRE_TYPES = [ ProtoBuf.WIRE_TYPES.VARINT, ProtoBuf.WIRE_TYPES.BITS64, ProtoBuf.WIRE_TYPES.BITS32 ];
        ProtoBuf.TYPES = {
          int32: {
            name: "int32",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: 0
          },
          uint32: {
            name: "uint32",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: 0
          },
          sint32: {
            name: "sint32",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: 0
          },
          int64: {
            name: "int64",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : void 0
          },
          uint64: {
            name: "uint64",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : void 0
          },
          sint64: {
            name: "sint64",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : void 0
          },
          bool: {
            name: "bool",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: false
          },
          double: {
            name: "double",
            wireType: ProtoBuf.WIRE_TYPES.BITS64,
            defaultValue: 0
          },
          string: {
            name: "string",
            wireType: ProtoBuf.WIRE_TYPES.LDELIM,
            defaultValue: ""
          },
          bytes: {
            name: "bytes",
            wireType: ProtoBuf.WIRE_TYPES.LDELIM,
            defaultValue: null
          },
          fixed32: {
            name: "fixed32",
            wireType: ProtoBuf.WIRE_TYPES.BITS32,
            defaultValue: 0
          },
          sfixed32: {
            name: "sfixed32",
            wireType: ProtoBuf.WIRE_TYPES.BITS32,
            defaultValue: 0
          },
          fixed64: {
            name: "fixed64",
            wireType: ProtoBuf.WIRE_TYPES.BITS64,
            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : void 0
          },
          sfixed64: {
            name: "sfixed64",
            wireType: ProtoBuf.WIRE_TYPES.BITS64,
            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : void 0
          },
          float: {
            name: "float",
            wireType: ProtoBuf.WIRE_TYPES.BITS32,
            defaultValue: 0
          },
          enum: {
            name: "enum",
            wireType: ProtoBuf.WIRE_TYPES.VARINT,
            defaultValue: 0
          },
          message: {
            name: "message",
            wireType: ProtoBuf.WIRE_TYPES.LDELIM,
            defaultValue: null
          },
          group: {
            name: "group",
            wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,
            defaultValue: null
          }
        };
        ProtoBuf.MAP_KEY_TYPES = [ ProtoBuf.TYPES["int32"], ProtoBuf.TYPES["sint32"], ProtoBuf.TYPES["sfixed32"], ProtoBuf.TYPES["uint32"], ProtoBuf.TYPES["fixed32"], ProtoBuf.TYPES["int64"], ProtoBuf.TYPES["sint64"], ProtoBuf.TYPES["sfixed64"], ProtoBuf.TYPES["uint64"], ProtoBuf.TYPES["fixed64"], ProtoBuf.TYPES["bool"], ProtoBuf.TYPES["string"], ProtoBuf.TYPES["bytes"] ];
        ProtoBuf.ID_MIN = 1;
        ProtoBuf.ID_MAX = 536870911;
        ProtoBuf.convertFieldsToCamelCase = false;
        ProtoBuf.populateAccessors = true;
        ProtoBuf.populateDefaults = true;
        ProtoBuf.Util = function() {
          var Util = {};
          Util.IS_NODE = !!("object" === typeof process && process + "" === "[object process]" && !process["browser"]);
          Util.XHR = function() {
            var XMLHttpFactories = [ function() {
              return new XMLHttpRequest();
            }, function() {
              return new ActiveXObject("Msxml2.XMLHTTP");
            }, function() {
              return new ActiveXObject("Msxml3.XMLHTTP");
            }, function() {
              return new ActiveXObject("Microsoft.XMLHTTP");
            } ];
            var xhr = null;
            for (var i = 0; i < XMLHttpFactories.length; i++) {
              try {
                xhr = XMLHttpFactories[i]();
              } catch (e) {
                continue;
              }
              break;
            }
            if (!xhr) throw Error("XMLHttpRequest is not supported");
            return xhr;
          };
          Util.fetch = function(path, callback) {
            callback && "function" != typeof callback && (callback = null);
            if (Util.IS_NODE) {
              var fs = require("fs");
              if (callback) fs.readFile(path, function(err, data) {
                callback(err ? null : "" + data);
              }); else try {
                return fs.readFileSync(path);
              } catch (e) {
                return null;
              }
            } else {
              var xhr = Util.XHR();
              xhr.open("GET", path, !!callback);
              xhr.setRequestHeader("Accept", "text/plain");
              "function" === typeof xhr.overrideMimeType && xhr.overrideMimeType("text/plain");
              if (!callback) {
                xhr.send(null);
                if (200 == xhr.status || 0 == xhr.status && "string" === typeof xhr.responseText) return xhr.responseText;
                return null;
              }
              xhr.onreadystatechange = function() {
                if (4 != xhr.readyState) return;
                200 == xhr.status || 0 == xhr.status && "string" === typeof xhr.responseText ? callback(xhr.responseText) : callback(null);
              };
              if (4 == xhr.readyState) return;
              xhr.send(null);
            }
          };
          Util.toCamelCase = function(str) {
            return str.replace(/_([a-zA-Z])/g, function($0, $1) {
              return $1.toUpperCase();
            });
          };
          return Util;
        }();
        ProtoBuf.Lang = {
          DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
          RULE: /^(?:required|optional|repeated|map)$/,
          TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
          NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
          TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
          TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
          FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
          NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
          NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
          NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
          NUMBER_OCT: /^0[0-7]+$/,
          NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
          BOOL: /^(?:true|false)$/i,
          ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
          NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
          WHITESPACE: /\s/,
          STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
          STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
          STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
        };
        ProtoBuf.DotProto = function(ProtoBuf, Lang) {
          var DotProto = {};
          var Tokenizer = function(proto) {
            this.source = proto + "";
            this.index = 0;
            this.line = 1;
            this.stack = [];
            this._stringOpen = null;
          };
          var TokenizerPrototype = Tokenizer.prototype;
          TokenizerPrototype._readString = function() {
            var re = '"' === this._stringOpen ? Lang.STRING_DQ : Lang.STRING_SQ;
            re.lastIndex = this.index - 1;
            var match = re.exec(this.source);
            if (!match) throw Error("unterminated string");
            this.index = re.lastIndex;
            this.stack.push(this._stringOpen);
            this._stringOpen = null;
            return match[1];
          };
          TokenizerPrototype.next = function() {
            if (this.stack.length > 0) return this.stack.shift();
            if (this.index >= this.source.length) return null;
            if (null !== this._stringOpen) return this._readString();
            var repeat, prev, next;
            do {
              repeat = false;
              while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) {
                "\n" === next && ++this.line;
                if (++this.index === this.source.length) return null;
              }
              if ("/" === this.source.charAt(this.index)) {
                ++this.index;
                if ("/" === this.source.charAt(this.index)) {
                  while ("\n" !== this.source.charAt(++this.index)) if (this.index == this.source.length) return null;
                  ++this.index;
                  ++this.line;
                  repeat = true;
                } else {
                  if ("*" !== (next = this.source.charAt(this.index))) return "/";
                  do {
                    "\n" === next && ++this.line;
                    if (++this.index === this.source.length) return null;
                    prev = next;
                    next = this.source.charAt(this.index);
                  } while ("*" !== prev || "/" !== next);
                  ++this.index;
                  repeat = true;
                }
              }
            } while (repeat);
            if (this.index === this.source.length) return null;
            var end = this.index;
            Lang.DELIM.lastIndex = 0;
            var delim = Lang.DELIM.test(this.source.charAt(end++));
            if (!delim) while (end < this.source.length && !Lang.DELIM.test(this.source.charAt(end))) ++end;
            var token = this.source.substring(this.index, this.index = end);
            '"' !== token && "'" !== token || (this._stringOpen = token);
            return token;
          };
          TokenizerPrototype.peek = function() {
            if (0 === this.stack.length) {
              var token = this.next();
              if (null === token) return null;
              this.stack.push(token);
            }
            return this.stack[0];
          };
          TokenizerPrototype.skip = function(expected) {
            var actual = this.next();
            if (actual !== expected) throw Error("illegal '" + actual + "', '" + expected + "' expected");
          };
          TokenizerPrototype.omit = function(expected) {
            if (this.peek() === expected) {
              this.next();
              return true;
            }
            return false;
          };
          TokenizerPrototype.toString = function() {
            return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")";
          };
          DotProto.Tokenizer = Tokenizer;
          var Parser = function(source) {
            this.tn = new Tokenizer(source);
            this.proto3 = false;
          };
          var ParserPrototype = Parser.prototype;
          ParserPrototype.parse = function() {
            var topLevel = {
              name: "[ROOT]",
              package: null,
              messages: [],
              enums: [],
              imports: [],
              options: {},
              services: []
            };
            var token, head = true, weak;
            try {
              while (token = this.tn.next()) switch (token) {
               case "package":
                if (!head || null !== topLevel["package"]) throw Error("unexpected 'package'");
                token = this.tn.next();
                if (!Lang.TYPEREF.test(token)) throw Error("illegal package name: " + token);
                this.tn.skip(";");
                topLevel["package"] = token;
                break;

               case "import":
                if (!head) throw Error("unexpected 'import'");
                token = this.tn.peek();
                ("public" === token || (weak = "weak" === token)) && this.tn.next();
                token = this._readString();
                this.tn.skip(";");
                weak || topLevel["imports"].push(token);
                break;

               case "syntax":
                if (!head) throw Error("unexpected 'syntax'");
                this.tn.skip("=");
                "proto3" === (topLevel["syntax"] = this._readString()) && (this.proto3 = true);
                this.tn.skip(";");
                break;

               case "message":
                this._parseMessage(topLevel, null);
                head = false;
                break;

               case "enum":
                this._parseEnum(topLevel);
                head = false;
                break;

               case "option":
                this._parseOption(topLevel);
                break;

               case "service":
                this._parseService(topLevel);
                break;

               case "extend":
                this._parseExtend(topLevel);
                break;

               default:
                throw Error("unexpected '" + token + "'");
              }
            } catch (e) {
              e.message = "Parse error at line " + this.tn.line + ": " + e.message;
              throw e;
            }
            delete topLevel["name"];
            return topLevel;
          };
          Parser.parse = function(source) {
            return new Parser(source).parse();
          };
          function mkId(value, mayBeNegative) {
            var id = -1, sign = 1;
            if ("-" == value.charAt(0)) {
              sign = -1;
              value = value.substring(1);
            }
            if (Lang.NUMBER_DEC.test(value)) id = parseInt(value); else if (Lang.NUMBER_HEX.test(value)) id = parseInt(value.substring(2), 16); else {
              if (!Lang.NUMBER_OCT.test(value)) throw Error("illegal id value: " + (sign < 0 ? "-" : "") + value);
              id = parseInt(value.substring(1), 8);
            }
            id = sign * id | 0;
            if (!mayBeNegative && id < 0) throw Error("illegal id value: " + (sign < 0 ? "-" : "") + value);
            return id;
          }
          function mkNumber(val) {
            var sign = 1;
            if ("-" == val.charAt(0)) {
              sign = -1;
              val = val.substring(1);
            }
            if (Lang.NUMBER_DEC.test(val)) return sign * parseInt(val, 10);
            if (Lang.NUMBER_HEX.test(val)) return sign * parseInt(val.substring(2), 16);
            if (Lang.NUMBER_OCT.test(val)) return sign * parseInt(val.substring(1), 8);
            if ("inf" === val) return Infinity * sign;
            if ("nan" === val) return NaN;
            if (Lang.NUMBER_FLT.test(val)) return sign * parseFloat(val);
            throw Error("illegal number value: " + (sign < 0 ? "-" : "") + val);
          }
          ParserPrototype._readString = function() {
            var value = "", token, delim;
            do {
              delim = this.tn.next();
              if ("'" !== delim && '"' !== delim) throw Error("illegal string delimiter: " + delim);
              value += this.tn.next();
              this.tn.skip(delim);
              token = this.tn.peek();
            } while ('"' === token || '"' === token);
            return value;
          };
          ParserPrototype._readValue = function(mayBeTypeRef) {
            var token = this.tn.peek(), value;
            if ('"' === token || "'" === token) return this._readString();
            this.tn.next();
            if (Lang.NUMBER.test(token)) return mkNumber(token);
            if (Lang.BOOL.test(token)) return "true" === token.toLowerCase();
            if (mayBeTypeRef && Lang.TYPEREF.test(token)) return token;
            throw Error("illegal value: " + token);
          };
          ParserPrototype._parseOption = function(parent, isList) {
            var token = this.tn.next(), custom = false;
            if ("(" === token) {
              custom = true;
              token = this.tn.next();
            }
            if (!Lang.TYPEREF.test(token)) throw Error("illegal option name: " + token);
            var name = token;
            if (custom) {
              this.tn.skip(")");
              name = "(" + name + ")";
              token = this.tn.peek();
              if (Lang.FQTYPEREF.test(token)) {
                name += token;
                this.tn.next();
              }
            }
            this.tn.skip("=");
            this._parseOptionValue(parent, name);
            isList || this.tn.skip(";");
          };
          function setOption(options, name, value) {
            if ("undefined" === typeof options[name]) options[name] = value; else {
              Array.isArray(options[name]) || (options[name] = [ options[name] ]);
              options[name].push(value);
            }
          }
          ParserPrototype._parseOptionValue = function(parent, name) {
            var token = this.tn.peek();
            if ("{" !== token) setOption(parent["options"], name, this._readValue(true)); else {
              this.tn.skip("{");
              while ("}" !== (token = this.tn.next())) {
                if (!Lang.NAME.test(token)) throw Error("illegal option name: " + name + "." + token);
                this.tn.omit(":") ? setOption(parent["options"], name + "." + token, this._readValue(true)) : this._parseOptionValue(parent, name + "." + token);
              }
            }
          };
          ParserPrototype._parseService = function(parent) {
            var token = this.tn.next();
            if (!Lang.NAME.test(token)) throw Error("illegal service name at line " + this.tn.line + ": " + token);
            var name = token;
            var svc = {
              name: name,
              rpc: {},
              options: {}
            };
            this.tn.skip("{");
            while ("}" !== (token = this.tn.next())) if ("option" === token) this._parseOption(svc); else {
              if ("rpc" !== token) throw Error("illegal service token: " + token);
              this._parseServiceRPC(svc);
            }
            this.tn.omit(";");
            parent["services"].push(svc);
          };
          ParserPrototype._parseServiceRPC = function(svc) {
            var type = "rpc", token = this.tn.next();
            if (!Lang.NAME.test(token)) throw Error("illegal rpc service method name: " + token);
            var name = token;
            var method = {
              request: null,
              response: null,
              request_stream: false,
              response_stream: false,
              options: {}
            };
            this.tn.skip("(");
            token = this.tn.next();
            if ("stream" === token.toLowerCase()) {
              method["request_stream"] = true;
              token = this.tn.next();
            }
            if (!Lang.TYPEREF.test(token)) throw Error("illegal rpc service request type: " + token);
            method["request"] = token;
            this.tn.skip(")");
            token = this.tn.next();
            if ("returns" !== token.toLowerCase()) throw Error("illegal rpc service request type delimiter: " + token);
            this.tn.skip("(");
            token = this.tn.next();
            if ("stream" === token.toLowerCase()) {
              method["response_stream"] = true;
              token = this.tn.next();
            }
            method["response"] = token;
            this.tn.skip(")");
            token = this.tn.peek();
            if ("{" === token) {
              this.tn.next();
              while ("}" !== (token = this.tn.next())) {
                if ("option" !== token) throw Error("illegal rpc service token: " + token);
                this._parseOption(method);
              }
              this.tn.omit(";");
            } else this.tn.skip(";");
            "undefined" === typeof svc[type] && (svc[type] = {});
            svc[type][name] = method;
          };
          ParserPrototype._parseMessage = function(parent, fld) {
            var isGroup = !!fld, token = this.tn.next();
            var msg = {
              name: "",
              fields: [],
              enums: [],
              messages: [],
              options: {},
              services: [],
              oneofs: {}
            };
            if (!Lang.NAME.test(token)) throw Error("illegal " + (isGroup ? "group" : "message") + " name: " + token);
            msg["name"] = token;
            if (isGroup) {
              this.tn.skip("=");
              fld["id"] = mkId(this.tn.next());
              msg["isGroup"] = true;
            }
            token = this.tn.peek();
            "[" === token && fld && this._parseFieldOptions(fld);
            this.tn.skip("{");
            while ("}" !== (token = this.tn.next())) if (Lang.RULE.test(token)) this._parseMessageField(msg, token); else if ("oneof" === token) this._parseMessageOneOf(msg); else if ("enum" === token) this._parseEnum(msg); else if ("message" === token) this._parseMessage(msg); else if ("option" === token) this._parseOption(msg); else if ("service" === token) this._parseService(msg); else if ("extensions" === token) msg.hasOwnProperty("extensions") ? msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges()) : msg["extensions"] = this._parseExtensionRanges(); else if ("reserved" === token) this._parseIgnored(); else if ("extend" === token) this._parseExtend(msg); else {
              if (!Lang.TYPEREF.test(token)) throw Error("illegal message token: " + token);
              if (!this.proto3) throw Error("illegal field rule: " + token);
              this._parseMessageField(msg, "optional", token);
            }
            this.tn.omit(";");
            parent["messages"].push(msg);
            return msg;
          };
          ParserPrototype._parseIgnored = function() {
            while (";" !== this.tn.peek()) this.tn.next();
            this.tn.skip(";");
          };
          ParserPrototype._parseMessageField = function(msg, rule, type) {
            if (!Lang.RULE.test(rule)) throw Error("illegal message field rule: " + rule);
            var fld = {
              rule: rule,
              type: "",
              name: "",
              options: {},
              id: 0
            };
            var token;
            if ("map" === rule) {
              if (type) throw Error("illegal type: " + type);
              this.tn.skip("<");
              token = this.tn.next();
              if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) throw Error("illegal message field type: " + token);
              fld["keytype"] = token;
              this.tn.skip(",");
              token = this.tn.next();
              if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) throw Error("illegal message field: " + token);
              fld["type"] = token;
              this.tn.skip(">");
              token = this.tn.next();
              if (!Lang.NAME.test(token)) throw Error("illegal message field name: " + token);
              fld["name"] = token;
              this.tn.skip("=");
              fld["id"] = mkId(this.tn.next());
              token = this.tn.peek();
              "[" === token && this._parseFieldOptions(fld);
              this.tn.skip(";");
            } else {
              type = "undefined" !== typeof type ? type : this.tn.next();
              if ("group" === type) {
                var grp = this._parseMessage(msg, fld);
                if (!/^[A-Z]/.test(grp["name"])) throw Error("illegal group name: " + grp["name"]);
                fld["type"] = grp["name"];
                fld["name"] = grp["name"].toLowerCase();
                this.tn.omit(";");
              } else {
                if (!Lang.TYPE.test(type) && !Lang.TYPEREF.test(type)) throw Error("illegal message field type: " + type);
                fld["type"] = type;
                token = this.tn.next();
                if (!Lang.NAME.test(token)) throw Error("illegal message field name: " + token);
                fld["name"] = token;
                this.tn.skip("=");
                fld["id"] = mkId(this.tn.next());
                token = this.tn.peek();
                "[" === token && this._parseFieldOptions(fld);
                this.tn.skip(";");
              }
            }
            msg["fields"].push(fld);
            return fld;
          };
          ParserPrototype._parseMessageOneOf = function(msg) {
            var token = this.tn.next();
            if (!Lang.NAME.test(token)) throw Error("illegal oneof name: " + token);
            var name = token, fld;
            var fields = [];
            this.tn.skip("{");
            while ("}" !== (token = this.tn.next())) {
              fld = this._parseMessageField(msg, "optional", token);
              fld["oneof"] = name;
              fields.push(fld["id"]);
            }
            this.tn.omit(";");
            msg["oneofs"][name] = fields;
          };
          ParserPrototype._parseFieldOptions = function(fld) {
            this.tn.skip("[");
            var token, first = true;
            while ("]" !== (token = this.tn.peek())) {
              first || this.tn.skip(",");
              this._parseOption(fld, true);
              first = false;
            }
            this.tn.next();
          };
          ParserPrototype._parseEnum = function(msg) {
            var enm = {
              name: "",
              values: [],
              options: {}
            };
            var token = this.tn.next();
            if (!Lang.NAME.test(token)) throw Error("illegal name: " + token);
            enm["name"] = token;
            this.tn.skip("{");
            while ("}" !== (token = this.tn.next())) if ("option" === token) this._parseOption(enm); else {
              if (!Lang.NAME.test(token)) throw Error("illegal name: " + token);
              this.tn.skip("=");
              var val = {
                name: token,
                id: mkId(this.tn.next(), true)
              };
              token = this.tn.peek();
              "[" === token && this._parseFieldOptions({
                options: {}
              });
              this.tn.skip(";");
              enm["values"].push(val);
            }
            this.tn.omit(";");
            msg["enums"].push(enm);
          };
          ParserPrototype._parseExtensionRanges = function() {
            var ranges = [];
            var token, range, value;
            do {
              range = [];
              while (true) {
                token = this.tn.next();
                switch (token) {
                 case "min":
                  value = ProtoBuf.ID_MIN;
                  break;

                 case "max":
                  value = ProtoBuf.ID_MAX;
                  break;

                 default:
                  value = mkNumber(token);
                }
                range.push(value);
                if (2 === range.length) break;
                if ("to" !== this.tn.peek()) {
                  range.push(value);
                  break;
                }
                this.tn.next();
              }
              ranges.push(range);
            } while (this.tn.omit(","));
            this.tn.skip(";");
            return ranges;
          };
          ParserPrototype._parseExtend = function(parent) {
            var token = this.tn.next();
            if (!Lang.TYPEREF.test(token)) throw Error("illegal extend reference: " + token);
            var ext = {
              ref: token,
              fields: []
            };
            this.tn.skip("{");
            while ("}" !== (token = this.tn.next())) if (Lang.RULE.test(token)) this._parseMessageField(ext, token); else {
              if (!Lang.TYPEREF.test(token)) throw Error("illegal extend token: " + token);
              if (!this.proto3) throw Error("illegal field rule: " + token);
              this._parseMessageField(ext, "optional", token);
            }
            this.tn.omit(";");
            parent["messages"].push(ext);
            return ext;
          };
          ParserPrototype.toString = function() {
            return "Parser at line " + this.tn.line;
          };
          DotProto.Parser = Parser;
          return DotProto;
        }(ProtoBuf, ProtoBuf.Lang);
        ProtoBuf.Reflect = function(ProtoBuf) {
          var Reflect = {};
          var T = function(builder, parent, name) {
            this.builder = builder;
            this.parent = parent;
            this.name = name;
            this.className;
          };
          var TPrototype = T.prototype;
          TPrototype.fqn = function() {
            var name = this.name, ptr = this;
            do {
              ptr = ptr.parent;
              if (null == ptr) break;
              name = ptr.name + "." + name;
            } while (true);
            return name;
          };
          TPrototype.toString = function(includeClass) {
            return (includeClass ? this.className + " " : "") + this.fqn();
          };
          TPrototype.build = function() {
            throw Error(this.toString(true) + " cannot be built directly");
          };
          Reflect.T = T;
          var Namespace = function(builder, parent, name, options, syntax) {
            T.call(this, builder, parent, name);
            this.className = "Namespace";
            this.children = [];
            this.options = options || {};
            this.syntax = syntax || "proto2";
          };
          var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);
          NamespacePrototype.getChildren = function(type) {
            type = type || null;
            if (null == type) return this.children.slice();
            var children = [];
            for (var i = 0, k = this.children.length; i < k; ++i) this.children[i] instanceof type && children.push(this.children[i]);
            return children;
          };
          NamespacePrototype.addChild = function(child) {
            var other;
            if (other = this.getChild(child.name)) if (other instanceof Message.Field && other.name !== other.originalName && null === this.getChild(other.originalName)) other.name = other.originalName; else {
              if (!(child instanceof Message.Field && child.name !== child.originalName && null === this.getChild(child.originalName))) throw Error("Duplicate name in namespace " + this.toString(true) + ": " + child.name);
              child.name = child.originalName;
            }
            this.children.push(child);
          };
          NamespacePrototype.getChild = function(nameOrId) {
            var key = "number" === typeof nameOrId ? "id" : "name";
            for (var i = 0, k = this.children.length; i < k; ++i) if (this.children[i][key] === nameOrId) return this.children[i];
            return null;
          };
          NamespacePrototype.resolve = function(qn, excludeNonNamespace) {
            var part = "string" === typeof qn ? qn.split(".") : qn, ptr = this, i = 0;
            if ("" === part[i]) {
              while (null !== ptr.parent) ptr = ptr.parent;
              i++;
            }
            var child;
            do {
              do {
                if (!(ptr instanceof Reflect.Namespace)) {
                  ptr = null;
                  break;
                }
                child = ptr.getChild(part[i]);
                if (!child || !(child instanceof Reflect.T) || excludeNonNamespace && !(child instanceof Reflect.Namespace)) {
                  ptr = null;
                  break;
                }
                ptr = child;
                i++;
              } while (i < part.length);
              if (null != ptr) break;
              if (null !== this.parent) return this.parent.resolve(qn, excludeNonNamespace);
            } while (null != ptr);
            return ptr;
          };
          NamespacePrototype.qn = function(t) {
            var part = [], ptr = t;
            do {
              part.unshift(ptr.name);
              ptr = ptr.parent;
            } while (null !== ptr);
            for (var len = 1; len <= part.length; len++) {
              var qn = part.slice(part.length - len);
              if (t === this.resolve(qn, t instanceof Reflect.Namespace)) return qn.join(".");
            }
            return t.fqn();
          };
          NamespacePrototype.build = function() {
            var ns = {};
            var children = this.children;
            for (var i = 0, k = children.length, child; i < k; ++i) {
              child = children[i];
              child instanceof Namespace && (ns[child.name] = child.build());
            }
            Object.defineProperty && Object.defineProperty(ns, "$options", {
              value: this.buildOpt()
            });
            return ns;
          };
          NamespacePrototype.buildOpt = function() {
            var opt = {}, keys = Object.keys(this.options);
            for (var i = 0, k = keys.length; i < k; ++i) {
              var key = keys[i], val = this.options[keys[i]];
              opt[key] = val;
            }
            return opt;
          };
          NamespacePrototype.getOption = function(name) {
            if ("undefined" === typeof name) return this.options;
            return "undefined" !== typeof this.options[name] ? this.options[name] : null;
          };
          Reflect.Namespace = Namespace;
          var Element = function(type, resolvedType, isMapKey, syntax, name) {
            this.type = type;
            this.resolvedType = resolvedType;
            this.isMapKey = isMapKey;
            this.syntax = syntax;
            this.name = name;
            if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) throw Error("Invalid map key type: " + type.name);
          };
          var ElementPrototype = Element.prototype;
          function mkDefault(type) {
            "string" === typeof type && (type = ProtoBuf.TYPES[type]);
            if ("undefined" === typeof type.defaultValue) throw Error("default value for type " + type.name + " is not supported");
            if (type == ProtoBuf.TYPES["bytes"]) return new ByteBuffer(0);
            return type.defaultValue;
          }
          Element.defaultFieldValue = mkDefault;
          function mkLong(value, unsigned) {
            if (value && "number" === typeof value.low && "number" === typeof value.high && "boolean" === typeof value.unsigned && value.low === value.low && value.high === value.high) return new ProtoBuf.Long(value.low, value.high, "undefined" === typeof unsigned ? value.unsigned : unsigned);
            if ("string" === typeof value) return ProtoBuf.Long.fromString(value, unsigned || false, 10);
            if ("number" === typeof value) return ProtoBuf.Long.fromNumber(value, unsigned || false);
            throw Error("not convertible to Long");
          }
          ElementPrototype.toString = function() {
            return (this.name || "") + (this.isMapKey ? "map" : "value") + " element";
          };
          ElementPrototype.verifyValue = function(value) {
            var self = this;
            function fail(val, msg) {
              throw Error("Illegal value for " + self.toString(true) + " of type " + self.type.name + ": " + val + " (" + msg + ")");
            }
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
             case ProtoBuf.TYPES["sint32"]:
             case ProtoBuf.TYPES["sfixed32"]:
              ("number" !== typeof value || value === value && value % 1 !== 0) && fail(typeof value, "not an integer");
              return value > 4294967295 ? 0 | value : value;

             case ProtoBuf.TYPES["uint32"]:
             case ProtoBuf.TYPES["fixed32"]:
              ("number" !== typeof value || value === value && value % 1 !== 0) && fail(typeof value, "not an integer");
              return value < 0 ? value >>> 0 : value;

             case ProtoBuf.TYPES["int64"]:
             case ProtoBuf.TYPES["sint64"]:
             case ProtoBuf.TYPES["sfixed64"]:
              if (ProtoBuf.Long) try {
                return mkLong(value, false);
              } catch (e) {
                fail(typeof value, e.message);
              } else fail(typeof value, "requires Long.js");

             case ProtoBuf.TYPES["uint64"]:
             case ProtoBuf.TYPES["fixed64"]:
              if (ProtoBuf.Long) try {
                return mkLong(value, true);
              } catch (e) {
                fail(typeof value, e.message);
              } else fail(typeof value, "requires Long.js");

             case ProtoBuf.TYPES["bool"]:
              "boolean" !== typeof value && fail(typeof value, "not a boolean");
              return value;

             case ProtoBuf.TYPES["float"]:
             case ProtoBuf.TYPES["double"]:
              "number" !== typeof value && fail(typeof value, "not a number");
              return value;

             case ProtoBuf.TYPES["string"]:
              "string" === typeof value || value && value instanceof String || fail(typeof value, "not a string");
              return "" + value;

             case ProtoBuf.TYPES["bytes"]:
              if (ByteBuffer.isByteBuffer(value)) return value;
              return ByteBuffer.wrap(value, "base64");

             case ProtoBuf.TYPES["enum"]:
              var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);
              for (i = 0; i < values.length; i++) {
                if (values[i].name == value) return values[i].id;
                if (values[i].id == value) return values[i].id;
              }
              if ("proto3" === this.syntax) {
                ("number" !== typeof value || value === value && value % 1 !== 0) && fail(typeof value, "not an integer");
                (value > 4294967295 || value < 0) && fail(typeof value, "not in range for uint32");
                return value;
              }
              fail(value, "not a valid enum value");

             case ProtoBuf.TYPES["group"]:
             case ProtoBuf.TYPES["message"]:
              value && "object" === typeof value || fail(typeof value, "object expected");
              if (value instanceof this.resolvedType.clazz) return value;
              if (value instanceof ProtoBuf.Builder.Message) {
                var obj = {};
                for (var i in value) value.hasOwnProperty(i) && (obj[i] = value[i]);
                value = obj;
              }
              return new this.resolvedType.clazz(value);
            }
            throw Error("[INTERNAL] Illegal value for " + this.toString(true) + ": " + value + " (undefined type " + this.type + ")");
          };
          ElementPrototype.calculateLength = function(id, value) {
            if (null === value) return 0;
            var n;
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
              return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);

             case ProtoBuf.TYPES["uint32"]:
              return ByteBuffer.calculateVarint32(value);

             case ProtoBuf.TYPES["sint32"]:
              return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));

             case ProtoBuf.TYPES["fixed32"]:
             case ProtoBuf.TYPES["sfixed32"]:
             case ProtoBuf.TYPES["float"]:
              return 4;

             case ProtoBuf.TYPES["int64"]:
             case ProtoBuf.TYPES["uint64"]:
              return ByteBuffer.calculateVarint64(value);

             case ProtoBuf.TYPES["sint64"]:
              return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));

             case ProtoBuf.TYPES["fixed64"]:
             case ProtoBuf.TYPES["sfixed64"]:
              return 8;

             case ProtoBuf.TYPES["bool"]:
              return 1;

             case ProtoBuf.TYPES["enum"]:
              return ByteBuffer.calculateVarint32(value);

             case ProtoBuf.TYPES["double"]:
              return 8;

             case ProtoBuf.TYPES["string"]:
              n = ByteBuffer.calculateUTF8Bytes(value);
              return ByteBuffer.calculateVarint32(n) + n;

             case ProtoBuf.TYPES["bytes"]:
              if (value.remaining() < 0) throw Error("Illegal value for " + this.toString(true) + ": " + value.remaining() + " bytes remaining");
              return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();

             case ProtoBuf.TYPES["message"]:
              n = this.resolvedType.calculate(value);
              return ByteBuffer.calculateVarint32(n) + n;

             case ProtoBuf.TYPES["group"]:
              n = this.resolvedType.calculate(value);
              return n + ByteBuffer.calculateVarint32(id << 3 | ProtoBuf.WIRE_TYPES.ENDGROUP);
            }
            throw Error("[INTERNAL] Illegal value to encode in " + this.toString(true) + ": " + value + " (unknown type)");
          };
          ElementPrototype.encodeValue = function(id, value, buffer) {
            if (null === value) return buffer;
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
              value < 0 ? buffer.writeVarint64(value) : buffer.writeVarint32(value);
              break;

             case ProtoBuf.TYPES["uint32"]:
              buffer.writeVarint32(value);
              break;

             case ProtoBuf.TYPES["sint32"]:
              buffer.writeVarint32ZigZag(value);
              break;

             case ProtoBuf.TYPES["fixed32"]:
              buffer.writeUint32(value);
              break;

             case ProtoBuf.TYPES["sfixed32"]:
              buffer.writeInt32(value);
              break;

             case ProtoBuf.TYPES["int64"]:
             case ProtoBuf.TYPES["uint64"]:
              buffer.writeVarint64(value);
              break;

             case ProtoBuf.TYPES["sint64"]:
              buffer.writeVarint64ZigZag(value);
              break;

             case ProtoBuf.TYPES["fixed64"]:
              buffer.writeUint64(value);
              break;

             case ProtoBuf.TYPES["sfixed64"]:
              buffer.writeInt64(value);
              break;

             case ProtoBuf.TYPES["bool"]:
              "string" === typeof value ? buffer.writeVarint32("false" === value.toLowerCase() ? 0 : !!value) : buffer.writeVarint32(value ? 1 : 0);
              break;

             case ProtoBuf.TYPES["enum"]:
              buffer.writeVarint32(value);
              break;

             case ProtoBuf.TYPES["float"]:
              buffer.writeFloat32(value);
              break;

             case ProtoBuf.TYPES["double"]:
              buffer.writeFloat64(value);
              break;

             case ProtoBuf.TYPES["string"]:
              buffer.writeVString(value);
              break;

             case ProtoBuf.TYPES["bytes"]:
              if (value.remaining() < 0) throw Error("Illegal value for " + this.toString(true) + ": " + value.remaining() + " bytes remaining");
              var prevOffset = value.offset;
              buffer.writeVarint32(value.remaining());
              buffer.append(value);
              value.offset = prevOffset;
              break;

             case ProtoBuf.TYPES["message"]:
              var bb = new ByteBuffer().LE();
              this.resolvedType.encode(value, bb);
              buffer.writeVarint32(bb.offset);
              buffer.append(bb.flip());
              break;

             case ProtoBuf.TYPES["group"]:
              this.resolvedType.encode(value, buffer);
              buffer.writeVarint32(id << 3 | ProtoBuf.WIRE_TYPES.ENDGROUP);
              break;

             default:
              throw Error("[INTERNAL] Illegal value to encode in " + this.toString(true) + ": " + value + " (unknown type)");
            }
            return buffer;
          };
          ElementPrototype.decode = function(buffer, wireType, id) {
            if (wireType != this.type.wireType) throw Error("Unexpected wire type for element");
            var value, nBytes;
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
              return 0 | buffer.readVarint32();

             case ProtoBuf.TYPES["uint32"]:
              return buffer.readVarint32() >>> 0;

             case ProtoBuf.TYPES["sint32"]:
              return 0 | buffer.readVarint32ZigZag();

             case ProtoBuf.TYPES["fixed32"]:
              return buffer.readUint32() >>> 0;

             case ProtoBuf.TYPES["sfixed32"]:
              return 0 | buffer.readInt32();

             case ProtoBuf.TYPES["int64"]:
              return buffer.readVarint64();

             case ProtoBuf.TYPES["uint64"]:
              return buffer.readVarint64().toUnsigned();

             case ProtoBuf.TYPES["sint64"]:
              return buffer.readVarint64ZigZag();

             case ProtoBuf.TYPES["fixed64"]:
              return buffer.readUint64();

             case ProtoBuf.TYPES["sfixed64"]:
              return buffer.readInt64();

             case ProtoBuf.TYPES["bool"]:
              return !!buffer.readVarint32();

             case ProtoBuf.TYPES["enum"]:
              return buffer.readVarint32();

             case ProtoBuf.TYPES["float"]:
              return buffer.readFloat();

             case ProtoBuf.TYPES["double"]:
              return buffer.readDouble();

             case ProtoBuf.TYPES["string"]:
              return buffer.readVString();

             case ProtoBuf.TYPES["bytes"]:
              nBytes = buffer.readVarint32();
              if (buffer.remaining() < nBytes) throw Error("Illegal number of bytes for " + this.toString(true) + ": " + nBytes + " required but got only " + buffer.remaining());
              value = buffer.clone();
              value.limit = value.offset + nBytes;
              buffer.offset += nBytes;
              return value;

             case ProtoBuf.TYPES["message"]:
              nBytes = buffer.readVarint32();
              return this.resolvedType.decode(buffer, nBytes);

             case ProtoBuf.TYPES["group"]:
              return this.resolvedType.decode(buffer, -1, id);
            }
            throw Error("[INTERNAL] Illegal decode type");
          };
          ElementPrototype.valueFromString = function(str) {
            if (!this.isMapKey) throw Error("valueFromString() called on non-map-key element");
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
             case ProtoBuf.TYPES["sint32"]:
             case ProtoBuf.TYPES["sfixed32"]:
             case ProtoBuf.TYPES["uint32"]:
             case ProtoBuf.TYPES["fixed32"]:
              return this.verifyValue(parseInt(str));

             case ProtoBuf.TYPES["int64"]:
             case ProtoBuf.TYPES["sint64"]:
             case ProtoBuf.TYPES["sfixed64"]:
             case ProtoBuf.TYPES["uint64"]:
             case ProtoBuf.TYPES["fixed64"]:
              return this.verifyValue(str);

             case ProtoBuf.TYPES["bool"]:
              return "true" === str;

             case ProtoBuf.TYPES["string"]:
              return this.verifyValue(str);

             case ProtoBuf.TYPES["bytes"]:
              return ByteBuffer.fromBinary(str);
            }
          };
          ElementPrototype.valueToString = function(value) {
            if (!this.isMapKey) throw Error("valueToString() called on non-map-key element");
            return this.type === ProtoBuf.TYPES["bytes"] ? value.toString("binary") : value.toString();
          };
          Reflect.Element = Element;
          var Message = function(builder, parent, name, options, isGroup, syntax) {
            Namespace.call(this, builder, parent, name, options, syntax);
            this.className = "Message";
            this.extensions = void 0;
            this.clazz = null;
            this.isGroup = !!isGroup;
            this._fields = null;
            this._fieldsById = null;
            this._fieldsByName = null;
          };
          var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);
          MessagePrototype.build = function(rebuild) {
            if (this.clazz && !rebuild) return this.clazz;
            var clazz = function(ProtoBuf, T) {
              var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
              var Message = function(values, var_args) {
                ProtoBuf.Builder.Message.call(this);
                for (var i = 0, k = oneofs.length; i < k; ++i) this[oneofs[i].name] = null;
                for (i = 0, k = fields.length; i < k; ++i) {
                  var field = fields[i];
                  this[field.name] = field.repeated ? [] : field.map ? new ProtoBuf.Map(field) : null;
                  !field.required && "proto3" !== T.syntax || null === field.defaultValue || (this[field.name] = field.defaultValue);
                }
                if (arguments.length > 0) {
                  var value;
                  if (1 !== arguments.length || null === values || "object" !== typeof values || !("function" !== typeof values.encode || values instanceof Message) || Array.isArray(values) || values instanceof ProtoBuf.Map || ByteBuffer.isByteBuffer(values) || values instanceof ArrayBuffer || ProtoBuf.Long && values instanceof ProtoBuf.Long) for (i = 0, 
                  k = arguments.length; i < k; ++i) "undefined" !== typeof (value = arguments[i]) && this.$set(fields[i].name, value); else this.$set(values);
                }
              };
              var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
              MessagePrototype.add = function(key, value, noAssert) {
                var field = T._fieldsByName[key];
                if (!noAssert) {
                  if (!field) throw Error(this + "#" + key + " is undefined");
                  if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: " + field.toString(true));
                  if (!field.repeated) throw Error(this + "#" + key + " is not a repeated field");
                  value = field.verifyValue(value, true);
                }
                null === this[key] && (this[key] = []);
                this[key].push(value);
                return this;
              };
              MessagePrototype.$add = MessagePrototype.add;
              MessagePrototype.set = function(keyOrObj, value, noAssert) {
                if (keyOrObj && "object" === typeof keyOrObj) {
                  noAssert = value;
                  for (var ikey in keyOrObj) keyOrObj.hasOwnProperty(ikey) && "undefined" !== typeof (value = keyOrObj[ikey]) && void 0 === T._oneofsByName[ikey] && this.$set(ikey, value, noAssert);
                  return this;
                }
                var field = T._fieldsByName[keyOrObj];
                if (noAssert) this[keyOrObj] = value; else {
                  if (!field) throw Error(this + "#" + keyOrObj + " is not a field: undefined");
                  if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + keyOrObj + " is not a field: " + field.toString(true));
                  this[field.name] = value = field.verifyValue(value);
                }
                if (field && field.oneof) {
                  var currentField = this[field.oneof.name];
                  if (null !== value) {
                    null !== currentField && currentField !== field.name && (this[currentField] = null);
                    this[field.oneof.name] = field.name;
                  } else currentField === keyOrObj && (this[field.oneof.name] = null);
                }
                return this;
              };
              MessagePrototype.$set = MessagePrototype.set;
              MessagePrototype.get = function(key, noAssert) {
                if (noAssert) return this[key];
                var field = T._fieldsByName[key];
                if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: undefined");
                if (!(field instanceof ProtoBuf.Reflect.Message.Field)) throw Error(this + "#" + key + " is not a field: " + field.toString(true));
                return this[field.name];
              };
              MessagePrototype.$get = MessagePrototype.get;
              for (var i = 0; i < fields.length; i++) {
                var field = fields[i];
                if (field instanceof ProtoBuf.Reflect.Message.ExtensionField) continue;
                T.builder.options["populateAccessors"] && function(field) {
                  var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
                    return match.toUpperCase().replace("_", "");
                  });
                  Name = Name.substring(0, 1).toUpperCase() + Name.substring(1);
                  var name = field.originalName.replace(/([A-Z])/g, function(match) {
                    return "_" + match;
                  });
                  var setter = function(value, noAssert) {
                    this[field.name] = noAssert ? value : field.verifyValue(value);
                    return this;
                  };
                  var getter = function() {
                    return this[field.name];
                  };
                  null === T.getChild("set" + Name) && (MessagePrototype["set" + Name] = setter);
                  null === T.getChild("set_" + name) && (MessagePrototype["set_" + name] = setter);
                  null === T.getChild("get" + Name) && (MessagePrototype["get" + Name] = getter);
                  null === T.getChild("get_" + name) && (MessagePrototype["get_" + name] = getter);
                }(field);
              }
              MessagePrototype.encode = function(buffer, noVerify) {
                "boolean" === typeof buffer && (noVerify = buffer, buffer = void 0);
                var isNew = false;
                buffer || (buffer = new ByteBuffer(), isNew = true);
                var le = buffer.littleEndian;
                try {
                  T.encode(this, buffer.LE(), noVerify);
                  return (isNew ? buffer.flip() : buffer).LE(le);
                } catch (e) {
                  buffer.LE(le);
                  throw e;
                }
              };
              Message.encode = function(data, buffer, noVerify) {
                return new Message(data).encode(buffer, noVerify);
              };
              MessagePrototype.calculate = function() {
                return T.calculate(this);
              };
              MessagePrototype.encodeDelimited = function(buffer, noVerify) {
                var isNew = false;
                buffer || (buffer = new ByteBuffer(), isNew = true);
                var enc = new ByteBuffer().LE();
                T.encode(this, enc, noVerify).flip();
                buffer.writeVarint32(enc.remaining());
                buffer.append(enc);
                return isNew ? buffer.flip() : buffer;
              };
              MessagePrototype.encodeAB = function() {
                try {
                  return this.encode().toArrayBuffer();
                } catch (e) {
                  e["encoded"] && (e["encoded"] = e["encoded"].toArrayBuffer());
                  throw e;
                }
              };
              MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
              MessagePrototype.encodeNB = function() {
                try {
                  return this.encode().toBuffer();
                } catch (e) {
                  e["encoded"] && (e["encoded"] = e["encoded"].toBuffer());
                  throw e;
                }
              };
              MessagePrototype.toBuffer = MessagePrototype.encodeNB;
              MessagePrototype.encode64 = function() {
                try {
                  return this.encode().toBase64();
                } catch (e) {
                  e["encoded"] && (e["encoded"] = e["encoded"].toBase64());
                  throw e;
                }
              };
              MessagePrototype.toBase64 = MessagePrototype.encode64;
              MessagePrototype.encodeHex = function() {
                try {
                  return this.encode().toHex();
                } catch (e) {
                  e["encoded"] && (e["encoded"] = e["encoded"].toHex());
                  throw e;
                }
              };
              MessagePrototype.toHex = MessagePrototype.encodeHex;
              function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {
                if (null === obj || "object" !== typeof obj) {
                  if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {
                    var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);
                    if (null !== name) return name;
                  }
                  return obj;
                }
                if (ByteBuffer.isByteBuffer(obj)) return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();
                if (ProtoBuf.Long.isLong(obj)) return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);
                var clone;
                if (Array.isArray(obj)) {
                  clone = [];
                  obj.forEach(function(v, k) {
                    clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);
                  });
                  return clone;
                }
                clone = {};
                if (obj instanceof ProtoBuf.Map) {
                  var it = obj.entries();
                  for (var e = it.next(); !e.done; e = it.next()) clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);
                  return clone;
                }
                var type = obj.$type, field = void 0;
                for (var i in obj) obj.hasOwnProperty(i) && (type && (field = type.getChild(i)) ? clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType) : clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings));
                return clone;
              }
              MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {
                return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);
              };
              MessagePrototype.encodeJSON = function() {
                return JSON.stringify(cloneRaw(this, true, true, this.$type));
              };
              Message.decode = function(buffer, length, enc) {
                "string" === typeof length && (enc = length, length = -1);
                "string" === typeof buffer ? buffer = ByteBuffer.wrap(buffer, enc || "base64") : ByteBuffer.isByteBuffer(buffer) || (buffer = ByteBuffer.wrap(buffer));
                var le = buffer.littleEndian;
                try {
                  var msg = T.decode(buffer.LE(), length);
                  buffer.LE(le);
                  return msg;
                } catch (e) {
                  buffer.LE(le);
                  throw e;
                }
              };
              Message.decodeDelimited = function(buffer, enc) {
                "string" === typeof buffer ? buffer = ByteBuffer.wrap(buffer, enc || "base64") : ByteBuffer.isByteBuffer(buffer) || (buffer = ByteBuffer.wrap(buffer));
                if (buffer.remaining() < 1) return null;
                var off = buffer.offset, len = buffer.readVarint32();
                if (buffer.remaining() < len) {
                  buffer.offset = off;
                  return null;
                }
                try {
                  var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
                  buffer.offset += len;
                  return msg;
                } catch (err) {
                  buffer.offset += len;
                  throw err;
                }
              };
              Message.decode64 = function(str) {
                return Message.decode(str, "base64");
              };
              Message.decodeHex = function(str) {
                return Message.decode(str, "hex");
              };
              Message.decodeJSON = function(str) {
                return new Message(JSON.parse(str));
              };
              MessagePrototype.toString = function() {
                return T.toString();
              };
              var $optionsS;
              var $options;
              var $typeS;
              var $type;
              Object.defineProperty && (Object.defineProperty(Message, "$options", {
                value: T.buildOpt()
              }), Object.defineProperty(MessagePrototype, "$options", {
                value: Message["$options"]
              }), Object.defineProperty(Message, "$type", {
                value: T
              }), Object.defineProperty(MessagePrototype, "$type", {
                value: T
              }));
              return Message;
            }(ProtoBuf, this);
            this._fields = [];
            this._fieldsById = {};
            this._fieldsByName = {};
            this._oneofsByName = {};
            for (var i = 0, k = this.children.length, child; i < k; i++) {
              child = this.children[i];
              if (child instanceof Enum || child instanceof Message || child instanceof Service) {
                if (clazz.hasOwnProperty(child.name)) throw Error("Illegal reflect child of " + this.toString(true) + ": " + child.toString(true) + " cannot override static property '" + child.name + "'");
                clazz[child.name] = child.build();
              } else if (child instanceof Message.Field) child.build(), this._fields.push(child), 
              this._fieldsById[child.id] = child, this._fieldsByName[child.name] = child; else if (child instanceof Message.OneOf) this._oneofsByName[child.name] = child; else if (!(child instanceof Message.OneOf) && !(child instanceof Extension)) throw Error("Illegal reflect child of " + this.toString(true) + ": " + this.children[i].toString(true));
            }
            return this.clazz = clazz;
          };
          MessagePrototype.encode = function(message, buffer, noVerify) {
            var fieldMissing = null, field;
            for (var i = 0, k = this._fields.length, val; i < k; ++i) {
              field = this._fields[i];
              val = message[field.name];
              field.required && null === val ? null === fieldMissing && (fieldMissing = field) : field.encode(noVerify ? val : field.verifyValue(val), buffer, message);
            }
            if (null !== fieldMissing) {
              var err = Error("Missing at least one required field for " + this.toString(true) + ": " + fieldMissing);
              err["encoded"] = buffer;
              throw err;
            }
            return buffer;
          };
          MessagePrototype.calculate = function(message) {
            for (var n = 0, i = 0, k = this._fields.length, field, val; i < k; ++i) {
              field = this._fields[i];
              val = message[field.name];
              if (field.required && null === val) throw Error("Missing at least one required field for " + this.toString(true) + ": " + field);
              n += field.calculate(val, message);
            }
            return n;
          };
          function skipTillGroupEnd(expectedId, buf) {
            var tag = buf.readVarint32(), wireType = 7 & tag, id = tag >>> 3;
            switch (wireType) {
             case ProtoBuf.WIRE_TYPES.VARINT:
              do {
                tag = buf.readUint8();
              } while (128 === (128 & tag));
              break;

             case ProtoBuf.WIRE_TYPES.BITS64:
              buf.offset += 8;
              break;

             case ProtoBuf.WIRE_TYPES.LDELIM:
              tag = buf.readVarint32();
              buf.offset += tag;
              break;

             case ProtoBuf.WIRE_TYPES.STARTGROUP:
              skipTillGroupEnd(id, buf);
              break;

             case ProtoBuf.WIRE_TYPES.ENDGROUP:
              if (id === expectedId) return false;
              throw Error("Illegal GROUPEND after unknown group: " + id + " (" + expectedId + " expected)");

             case ProtoBuf.WIRE_TYPES.BITS32:
              buf.offset += 4;
              break;

             default:
              throw Error("Illegal wire type in unknown group " + expectedId + ": " + wireType);
            }
            return true;
          }
          MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {
            "number" !== typeof length && (length = -1);
            var start = buffer.offset, msg = new this.clazz(), tag, wireType, id, field;
            while (buffer.offset < start + length || -1 === length && buffer.remaining() > 0) {
              tag = buffer.readVarint32();
              wireType = 7 & tag;
              id = tag >>> 3;
              if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {
                if (id !== expectedGroupEndId) throw Error("Illegal group end indicator for " + this.toString(true) + ": " + id + " (" + (expectedGroupEndId ? expectedGroupEndId + " expected" : "not a group") + ")");
                break;
              }
              if (!(field = this._fieldsById[id])) {
                switch (wireType) {
                 case ProtoBuf.WIRE_TYPES.VARINT:
                  buffer.readVarint32();
                  break;

                 case ProtoBuf.WIRE_TYPES.BITS32:
                  buffer.offset += 4;
                  break;

                 case ProtoBuf.WIRE_TYPES.BITS64:
                  buffer.offset += 8;
                  break;

                 case ProtoBuf.WIRE_TYPES.LDELIM:
                  var len = buffer.readVarint32();
                  buffer.offset += len;
                  break;

                 case ProtoBuf.WIRE_TYPES.STARTGROUP:
                  while (skipTillGroupEnd(id, buffer)) ;
                  break;

                 default:
                  throw Error("Illegal wire type for unknown field " + id + " in " + this.toString(true) + "#decode: " + wireType);
                }
                continue;
              }
              if (field.repeated && !field.options["packed"]) msg[field.name].push(field.decode(wireType, buffer)); else if (field.map) {
                var keyval = field.decode(wireType, buffer);
                msg[field.name].set(keyval[0], keyval[1]);
              } else {
                msg[field.name] = field.decode(wireType, buffer);
                if (field.oneof) {
                  var currentField = msg[field.oneof.name];
                  null !== currentField && currentField !== field.name && (msg[currentField] = null);
                  msg[field.oneof.name] = field.name;
                }
              }
            }
            for (var i = 0, k = this._fields.length; i < k; ++i) {
              field = this._fields[i];
              if (null === msg[field.name]) if ("proto3" === this.syntax) msg[field.name] = field.defaultValue; else {
                if (field.required) {
                  var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);
                  err["decoded"] = msg;
                  throw err;
                }
                ProtoBuf.populateDefaults && null !== field.defaultValue && (msg[field.name] = field.defaultValue);
              }
            }
            return msg;
          };
          Reflect.Message = Message;
          var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {
            T.call(this, builder, message, name);
            this.className = "Message.Field";
            this.required = "required" === rule;
            this.repeated = "repeated" === rule;
            this.map = "map" === rule;
            this.keyType = keytype || null;
            this.type = type;
            this.resolvedType = null;
            this.id = id;
            this.options = options || {};
            this.defaultValue = null;
            this.oneof = oneof || null;
            this.syntax = syntax || "proto2";
            this.originalName = this.name;
            this.element = null;
            this.keyElement = null;
            !this.builder.options["convertFieldsToCamelCase"] || this instanceof Message.ExtensionField || (this.name = ProtoBuf.Util.toCamelCase(this.name));
          };
          var FieldPrototype = Field.prototype = Object.create(T.prototype);
          FieldPrototype.build = function() {
            this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);
            this.map && (this.keyElement = new Element(this.keyType, void 0, true, this.syntax, this.name));
            "proto3" !== this.syntax || this.repeated || this.map ? "undefined" !== typeof this.options["default"] && (this.defaultValue = this.verifyValue(this.options["default"])) : this.defaultValue = Element.defaultFieldValue(this.type);
          };
          FieldPrototype.verifyValue = function(value, skipRepeated) {
            skipRepeated = skipRepeated || false;
            var self = this;
            function fail(val, msg) {
              throw Error("Illegal value for " + self.toString(true) + " of type " + self.type.name + ": " + val + " (" + msg + ")");
            }
            if (null === value) {
              this.required && fail(typeof value, "required");
              "proto3" === this.syntax && this.type !== ProtoBuf.TYPES["message"] && fail(typeof value, "proto3 field without field presence cannot be null");
              return null;
            }
            var i;
            if (this.repeated && !skipRepeated) {
              Array.isArray(value) || (value = [ value ]);
              var res = [];
              for (i = 0; i < value.length; i++) res.push(this.element.verifyValue(value[i]));
              return res;
            }
            if (this.map && !skipRepeated) {
              if (value instanceof ProtoBuf.Map) return value;
              value instanceof Object || fail(typeof value, "expected ProtoBuf.Map or raw object for map field");
              return new ProtoBuf.Map(this, value);
            }
            !this.repeated && Array.isArray(value) && fail(typeof value, "no array expected");
            return this.element.verifyValue(value);
          };
          FieldPrototype.hasWirePresence = function(value, message) {
            if ("proto3" !== this.syntax) return null !== value;
            if (this.oneof && message[this.oneof.name] === this.name) return true;
            switch (this.type) {
             case ProtoBuf.TYPES["int32"]:
             case ProtoBuf.TYPES["sint32"]:
             case ProtoBuf.TYPES["sfixed32"]:
             case ProtoBuf.TYPES["uint32"]:
             case ProtoBuf.TYPES["fixed32"]:
              return 0 !== value;

             case ProtoBuf.TYPES["int64"]:
             case ProtoBuf.TYPES["sint64"]:
             case ProtoBuf.TYPES["sfixed64"]:
             case ProtoBuf.TYPES["uint64"]:
             case ProtoBuf.TYPES["fixed64"]:
              return 0 !== value.low || 0 !== value.high;

             case ProtoBuf.TYPES["bool"]:
              return value;

             case ProtoBuf.TYPES["float"]:
             case ProtoBuf.TYPES["double"]:
              return 0 !== value;

             case ProtoBuf.TYPES["string"]:
              return value.length > 0;

             case ProtoBuf.TYPES["bytes"]:
              return value.remaining() > 0;

             case ProtoBuf.TYPES["enum"]:
              return 0 !== value;

             case ProtoBuf.TYPES["message"]:
              return null !== value;

             default:
              return true;
            }
          };
          FieldPrototype.encode = function(value, buffer, message) {
            if (null === this.type || "object" !== typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(true) + ": " + this.type);
            if (null === value || this.repeated && 0 == value.length) return buffer;
            try {
              if (this.repeated) {
                var i;
                if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
                  buffer.writeVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM);
                  buffer.ensureCapacity(buffer.offset += 1);
                  var start = buffer.offset;
                  for (i = 0; i < value.length; i++) this.element.encodeValue(this.id, value[i], buffer);
                  var len = buffer.offset - start, varintLen = ByteBuffer.calculateVarint32(len);
                  if (varintLen > 1) {
                    var contents = buffer.slice(start, buffer.offset);
                    start += varintLen - 1;
                    buffer.offset = start;
                    buffer.append(contents);
                  }
                  buffer.writeVarint32(len, start - varintLen);
                } else for (i = 0; i < value.length; i++) buffer.writeVarint32(this.id << 3 | this.type.wireType), 
                this.element.encodeValue(this.id, value[i], buffer);
              } else if (this.map) value.forEach(function(val, key, m) {
                var length = ByteBuffer.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, key) + ByteBuffer.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, val);
                buffer.writeVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM);
                buffer.writeVarint32(length);
                buffer.writeVarint32(8 | this.keyType.wireType);
                this.keyElement.encodeValue(1, key, buffer);
                buffer.writeVarint32(16 | this.type.wireType);
                this.element.encodeValue(2, val, buffer);
              }, this); else if (this.hasWirePresence(value, message)) {
                buffer.writeVarint32(this.id << 3 | this.type.wireType);
                this.element.encodeValue(this.id, value, buffer);
              }
            } catch (e) {
              throw Error("Illegal value for " + this.toString(true) + ": " + value + " (" + e + ")");
            }
            return buffer;
          };
          FieldPrototype.calculate = function(value, message) {
            value = this.verifyValue(value);
            if (null === this.type || "object" !== typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(true) + ": " + this.type);
            if (null === value || this.repeated && 0 == value.length) return 0;
            var n = 0;
            try {
              if (this.repeated) {
                var i, ni;
                if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
                  n += ByteBuffer.calculateVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM);
                  ni = 0;
                  for (i = 0; i < value.length; i++) ni += this.element.calculateLength(this.id, value[i]);
                  n += ByteBuffer.calculateVarint32(ni);
                  n += ni;
                } else for (i = 0; i < value.length; i++) n += ByteBuffer.calculateVarint32(this.id << 3 | this.type.wireType), 
                n += this.element.calculateLength(this.id, value[i]);
              } else if (this.map) value.forEach(function(val, key, m) {
                var length = ByteBuffer.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, key) + ByteBuffer.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, val);
                n += ByteBuffer.calculateVarint32(this.id << 3 | ProtoBuf.WIRE_TYPES.LDELIM);
                n += ByteBuffer.calculateVarint32(length);
                n += length;
              }, this); else if (this.hasWirePresence(value, message)) {
                n += ByteBuffer.calculateVarint32(this.id << 3 | this.type.wireType);
                n += this.element.calculateLength(this.id, value);
              }
            } catch (e) {
              throw Error("Illegal value for " + this.toString(true) + ": " + value + " (" + e + ")");
            }
            return n;
          };
          FieldPrototype.decode = function(wireType, buffer, skipRepeated) {
            var value, nBytes;
            var wireTypeOK = !this.map && wireType == this.type.wireType || !skipRepeated && this.repeated && this.options["packed"] && wireType == ProtoBuf.WIRE_TYPES.LDELIM || this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM;
            if (!wireTypeOK) throw Error("Illegal wire type for field " + this.toString(true) + ": " + wireType + " (" + this.type.wireType + " expected)");
            if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !skipRepeated) {
              nBytes = buffer.readVarint32();
              nBytes = buffer.offset + nBytes;
              var values = [];
              while (buffer.offset < nBytes) values.push(this.decode(this.type.wireType, buffer, true));
              return values;
            }
            if (this.map) {
              var key = Element.defaultFieldValue(this.keyType);
              value = Element.defaultFieldValue(this.type);
              nBytes = buffer.readVarint32();
              if (buffer.remaining() < nBytes) throw Error("Illegal number of bytes for " + this.toString(true) + ": " + nBytes + " required but got only " + buffer.remaining());
              var msgbuf = buffer.clone();
              msgbuf.limit = msgbuf.offset + nBytes;
              buffer.offset += nBytes;
              while (msgbuf.remaining() > 0) {
                var tag = msgbuf.readVarint32();
                wireType = 7 & tag;
                var id = tag >>> 3;
                if (1 === id) key = this.keyElement.decode(msgbuf, wireType, id); else {
                  if (2 !== id) throw Error("Unexpected tag in map field key/value submessage");
                  value = this.element.decode(msgbuf, wireType, id);
                }
              }
              return [ key, value ];
            }
            return this.element.decode(buffer, wireType, this.id);
          };
          Reflect.Message.Field = Field;
          var ExtensionField = function(builder, message, rule, type, name, id, options) {
            Field.call(this, builder, message, rule, null, type, name, id, options);
            this.extension;
          };
          ExtensionField.prototype = Object.create(Field.prototype);
          Reflect.Message.ExtensionField = ExtensionField;
          var OneOf = function(builder, message, name) {
            T.call(this, builder, message, name);
            this.fields = [];
          };
          Reflect.Message.OneOf = OneOf;
          var Enum = function(builder, parent, name, options, syntax) {
            Namespace.call(this, builder, parent, name, options, syntax);
            this.className = "Enum";
            this.object = null;
          };
          Enum.getName = function(enm, value) {
            var keys = Object.keys(enm);
            for (var i = 0, key; i < keys.length; ++i) if (enm[key = keys[i]] === value) return key;
            return null;
          };
          var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);
          EnumPrototype.build = function(rebuild) {
            if (this.object && !rebuild) return this.object;
            var enm = new ProtoBuf.Builder.Enum(), values = this.getChildren(Enum.Value);
            for (var i = 0, k = values.length; i < k; ++i) enm[values[i]["name"]] = values[i]["id"];
            Object.defineProperty && Object.defineProperty(enm, "$options", {
              value: this.buildOpt(),
              enumerable: false
            });
            return this.object = enm;
          };
          Reflect.Enum = Enum;
          var Value = function(builder, enm, name, id) {
            T.call(this, builder, enm, name);
            this.className = "Enum.Value";
            this.id = id;
          };
          Value.prototype = Object.create(T.prototype);
          Reflect.Enum.Value = Value;
          var Extension = function(builder, parent, name, field) {
            T.call(this, builder, parent, name);
            this.field = field;
          };
          Extension.prototype = Object.create(T.prototype);
          Reflect.Extension = Extension;
          var Service = function(builder, root, name, options) {
            Namespace.call(this, builder, root, name, options);
            this.className = "Service";
            this.clazz = null;
          };
          var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);
          ServicePrototype.build = function(rebuild) {
            if (this.clazz && !rebuild) return this.clazz;
            return this.clazz = function(ProtoBuf, T) {
              var Service = function(rpcImpl) {
                ProtoBuf.Builder.Service.call(this);
                this.rpcImpl = rpcImpl || function(name, msg, callback) {
                  setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0);
                };
              };
              var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
              var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
              for (var i = 0; i < rpc.length; i++) (function(method) {
                ServicePrototype[method.name] = function(req, callback) {
                  try {
                    try {
                      req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));
                    } catch (err) {
                      if (!(err instanceof TypeError)) throw err;
                    }
                    if (null === req || "object" !== typeof req) throw Error("Illegal arguments");
                    req instanceof method.resolvedRequestType.clazz || (req = new method.resolvedRequestType.clazz(req));
                    this.rpcImpl(method.fqn(), req, function(err, res) {
                      if (err) {
                        callback(err);
                        return;
                      }
                      null === res && (res = "");
                      try {
                        res = method.resolvedResponseType.clazz.decode(res);
                      } catch (notABuffer) {}
                      if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
                        callback(Error("Illegal response type received in service method " + T.name + "#" + method.name));
                        return;
                      }
                      callback(null, res);
                    });
                  } catch (err) {
                    setTimeout(callback.bind(this, err), 0);
                  }
                };
                Service[method.name] = function(rpcImpl, req, callback) {
                  new Service(rpcImpl)[method.name](req, callback);
                };
                Object.defineProperty && (Object.defineProperty(Service[method.name], "$options", {
                  value: method.buildOpt()
                }), Object.defineProperty(ServicePrototype[method.name], "$options", {
                  value: Service[method.name]["$options"]
                }));
              })(rpc[i]);
              var $optionsS;
              var $options;
              var $typeS;
              var $type;
              Object.defineProperty && (Object.defineProperty(Service, "$options", {
                value: T.buildOpt()
              }), Object.defineProperty(ServicePrototype, "$options", {
                value: Service["$options"]
              }), Object.defineProperty(Service, "$type", {
                value: T
              }), Object.defineProperty(ServicePrototype, "$type", {
                value: T
              }));
              return Service;
            }(ProtoBuf, this);
          };
          Reflect.Service = Service;
          var Method = function(builder, svc, name, options) {
            T.call(this, builder, svc, name);
            this.className = "Service.Method";
            this.options = options || {};
          };
          var MethodPrototype = Method.prototype = Object.create(T.prototype);
          MethodPrototype.buildOpt = NamespacePrototype.buildOpt;
          Reflect.Service.Method = Method;
          var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {
            Method.call(this, builder, svc, name, options);
            this.className = "Service.RPCMethod";
            this.requestName = request;
            this.responseName = response;
            this.requestStream = request_stream;
            this.responseStream = response_stream;
            this.resolvedRequestType = null;
            this.resolvedResponseType = null;
          };
          RPCMethod.prototype = Object.create(Method.prototype);
          Reflect.Service.RPCMethod = RPCMethod;
          return Reflect;
        }(ProtoBuf);
        ProtoBuf.Builder = function(ProtoBuf, Lang, Reflect) {
          var Builder = function(options) {
            this.ns = new Reflect.Namespace(this, null, "");
            this.ptr = this.ns;
            this.resolved = false;
            this.result = null;
            this.files = {};
            this.importRoot = null;
            this.options = options || {};
          };
          var BuilderPrototype = Builder.prototype;
          Builder.isMessage = function(def) {
            if ("string" !== typeof def["name"]) return false;
            if ("undefined" !== typeof def["values"] || "undefined" !== typeof def["rpc"]) return false;
            return true;
          };
          Builder.isMessageField = function(def) {
            if ("string" !== typeof def["rule"] || "string" !== typeof def["name"] || "string" !== typeof def["type"] || "undefined" === typeof def["id"]) return false;
            return true;
          };
          Builder.isEnum = function(def) {
            if ("string" !== typeof def["name"]) return false;
            if ("undefined" === typeof def["values"] || !Array.isArray(def["values"]) || 0 === def["values"].length) return false;
            return true;
          };
          Builder.isService = function(def) {
            if ("string" !== typeof def["name"] || "object" !== typeof def["rpc"] || !def["rpc"]) return false;
            return true;
          };
          Builder.isExtend = function(def) {
            if ("string" !== typeof def["ref"]) return false;
            return true;
          };
          BuilderPrototype.reset = function() {
            this.ptr = this.ns;
            return this;
          };
          BuilderPrototype.define = function(namespace) {
            if ("string" !== typeof namespace || !Lang.TYPEREF.test(namespace)) throw Error("illegal namespace: " + namespace);
            namespace.split(".").forEach(function(part) {
              var ns = this.ptr.getChild(part);
              null === ns && this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));
              this.ptr = ns;
            }, this);
            return this;
          };
          BuilderPrototype.create = function(defs) {
            if (!defs) return this;
            if (Array.isArray(defs)) {
              if (0 === defs.length) return this;
              defs = defs.slice();
            } else defs = [ defs ];
            var stack = [ defs ];
            while (stack.length > 0) {
              defs = stack.pop();
              if (!Array.isArray(defs)) throw Error("not a valid namespace: " + JSON.stringify(defs));
              while (defs.length > 0) {
                var def = defs.shift();
                if (Builder.isMessage(def)) {
                  var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);
                  var oneofs = {};
                  def["oneofs"] && Object.keys(def["oneofs"]).forEach(function(name) {
                    obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));
                  }, this);
                  def["fields"] && def["fields"].forEach(function(fld) {
                    if (null !== obj.getChild(0 | fld["id"])) throw Error("duplicate or invalid field id in " + obj.name + ": " + fld["id"]);
                    if (fld["options"] && "object" !== typeof fld["options"]) throw Error("illegal field options in " + obj.name + "#" + fld["name"]);
                    var oneof = null;
                    if ("string" === typeof fld["oneof"] && !(oneof = oneofs[fld["oneof"]])) throw Error("illegal oneof in " + obj.name + "#" + fld["name"] + ": " + fld["oneof"]);
                    fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);
                    oneof && oneof.fields.push(fld);
                    obj.addChild(fld);
                  }, this);
                  var subObj = [];
                  def["enums"] && def["enums"].forEach(function(enm) {
                    subObj.push(enm);
                  });
                  def["messages"] && def["messages"].forEach(function(msg) {
                    subObj.push(msg);
                  });
                  def["services"] && def["services"].forEach(function(svc) {
                    subObj.push(svc);
                  });
                  def["extensions"] && ("number" === typeof def["extensions"][0] ? obj.extensions = [ def["extensions"] ] : obj.extensions = def["extensions"]);
                  this.ptr.addChild(obj);
                  if (subObj.length > 0) {
                    stack.push(defs);
                    defs = subObj;
                    subObj = null;
                    this.ptr = obj;
                    obj = null;
                    continue;
                  }
                  subObj = null;
                } else if (Builder.isEnum(def)) {
                  obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);
                  def["values"].forEach(function(val) {
                    obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));
                  }, this);
                  this.ptr.addChild(obj);
                } else if (Builder.isService(def)) {
                  obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
                  Object.keys(def["rpc"]).forEach(function(name) {
                    var mtd = def["rpc"][name];
                    obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));
                  }, this);
                  this.ptr.addChild(obj);
                } else {
                  if (!Builder.isExtend(def)) throw Error("not a valid definition: " + JSON.stringify(def));
                  obj = this.ptr.resolve(def["ref"], true);
                  if (obj) def["fields"].forEach(function(fld) {
                    if (null !== obj.getChild(0 | fld["id"])) throw Error("duplicate extended field id in " + obj.name + ": " + fld["id"]);
                    if (obj.extensions) {
                      var valid = false;
                      obj.extensions.forEach(function(range) {
                        fld["id"] >= range[0] && fld["id"] <= range[1] && (valid = true);
                      });
                      if (!valid) throw Error("illegal extended field id in " + obj.name + ": " + fld["id"] + " (not within valid ranges)");
                    }
                    var name = fld["name"];
                    this.options["convertFieldsToCamelCase"] && (name = ProtoBuf.Util.toCamelCase(name));
                    var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn() + "." + name, fld["id"], fld["options"]);
                    var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);
                    field.extension = ext;
                    this.ptr.addChild(ext);
                    obj.addChild(field);
                  }, this); else if (!/\.?google\.protobuf\./.test(def["ref"])) throw Error("extended message " + def["ref"] + " is not defined");
                }
                def = null;
                obj = null;
              }
              defs = null;
              this.ptr = this.ptr.parent;
            }
            this.resolved = false;
            this.result = null;
            return this;
          };
          function propagateSyntax(parent) {
            parent["messages"] && parent["messages"].forEach(function(child) {
              child["syntax"] = parent["syntax"];
              propagateSyntax(child);
            });
            parent["enums"] && parent["enums"].forEach(function(child) {
              child["syntax"] = parent["syntax"];
            });
          }
          BuilderPrototype["import"] = function(json, filename) {
            var delim = "/";
            if ("string" === typeof filename) {
              ProtoBuf.Util.IS_NODE && (filename = require("path")["resolve"](filename));
              if (true === this.files[filename]) return this.reset();
              this.files[filename] = true;
            } else if ("object" === typeof filename) {
              var root = filename.root;
              ProtoBuf.Util.IS_NODE && (root = require("path")["resolve"](root));
              (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) && (delim = "\\");
              var fname;
              fname = ProtoBuf.Util.IS_NODE ? require("path")["join"](root, filename.file) : root + delim + filename.file;
              if (true === this.files[fname]) return this.reset();
              this.files[fname] = true;
            }
            if (json["imports"] && json["imports"].length > 0) {
              var importRoot, resetRoot = false;
              if ("object" === typeof filename) {
                this.importRoot = filename["root"];
                resetRoot = true;
                importRoot = this.importRoot;
                filename = filename["file"];
                (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) && (delim = "\\");
              } else if ("string" === typeof filename) if (this.importRoot) importRoot = this.importRoot; else if (filename.indexOf("/") >= 0) {
                importRoot = filename.replace(/\/[^\/]*$/, "");
                "" === importRoot && (importRoot = "/");
              } else if (filename.indexOf("\\") >= 0) {
                importRoot = filename.replace(/\\[^\\]*$/, "");
                delim = "\\";
              } else importRoot = "."; else importRoot = null;
              for (var i = 0; i < json["imports"].length; i++) if ("string" === typeof json["imports"][i]) {
                if (!importRoot) throw Error("cannot determine import root");
                var importFilename = json["imports"][i];
                if ("google/protobuf/descriptor.proto" === importFilename) continue;
                importFilename = ProtoBuf.Util.IS_NODE ? require("path")["join"](importRoot, importFilename) : importRoot + delim + importFilename;
                if (true === this.files[importFilename]) continue;
                /\.proto$/i.test(importFilename) && !ProtoBuf.DotProto && (importFilename = importFilename.replace(/\.proto$/, ".json"));
                var contents = ProtoBuf.Util.fetch(importFilename);
                if (null === contents) throw Error("failed to import '" + importFilename + "' in '" + filename + "': file not found");
                /\.json$/i.test(importFilename) ? this["import"](JSON.parse(contents + ""), importFilename) : this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename);
              } else filename ? /\.(\w+)$/.test(filename) ? this["import"](json["imports"][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) {
                return $1 + "_import" + i + "." + $2;
              })) : this["import"](json["imports"][i], filename + "_import" + i) : this["import"](json["imports"][i]);
              resetRoot && (this.importRoot = null);
            }
            json["package"] && this.define(json["package"]);
            json["syntax"] && propagateSyntax(json);
            var base = this.ptr;
            json["options"] && Object.keys(json["options"]).forEach(function(key) {
              base.options[key] = json["options"][key];
            });
            json["messages"] && (this.create(json["messages"]), this.ptr = base);
            json["enums"] && (this.create(json["enums"]), this.ptr = base);
            json["services"] && (this.create(json["services"]), this.ptr = base);
            json["extends"] && this.create(json["extends"]);
            return this.reset();
          };
          BuilderPrototype.resolveAll = function() {
            var res;
            if (null == this.ptr || "object" === typeof this.ptr.type) return this;
            if (this.ptr instanceof Reflect.Namespace) this.ptr.children.forEach(function(child) {
              this.ptr = child;
              this.resolveAll();
            }, this); else if (this.ptr instanceof Reflect.Message.Field) {
              if (Lang.TYPE.test(this.ptr.type)) this.ptr.type = ProtoBuf.TYPES[this.ptr.type]; else {
                if (!Lang.TYPEREF.test(this.ptr.type)) throw Error("illegal type reference in " + this.ptr.toString(true) + ": " + this.ptr.type);
                res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
                if (!res) throw Error("unresolvable type reference in " + this.ptr.toString(true) + ": " + this.ptr.type);
                this.ptr.resolvedType = res;
                if (res instanceof Reflect.Enum) {
                  this.ptr.type = ProtoBuf.TYPES["enum"];
                  if ("proto3" === this.ptr.syntax && "proto3" !== res.syntax) throw Error("proto3 message cannot reference proto2 enum");
                } else {
                  if (!(res instanceof Reflect.Message)) throw Error("illegal type reference in " + this.ptr.toString(true) + ": " + this.ptr.type);
                  this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
                }
              }
              if (this.ptr.map) {
                if (!Lang.TYPE.test(this.ptr.keyType)) throw Error("illegal key type for map field in " + this.ptr.toString(true) + ": " + this.ptr.keyType);
                this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];
              }
              "proto3" === this.ptr.syntax && this.ptr.repeated && void 0 === this.ptr.options.packed && -1 !== ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) && (this.ptr.options.packed = true);
            } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
              if (!(this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod)) throw Error("illegal service type in " + this.ptr.toString(true));
              res = this.ptr.parent.resolve(this.ptr.requestName, true);
              if (!res || !(res instanceof ProtoBuf.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(true) + ": " + this.ptr.requestName);
              this.ptr.resolvedRequestType = res;
              res = this.ptr.parent.resolve(this.ptr.responseName, true);
              if (!res || !(res instanceof ProtoBuf.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(true) + ": " + this.ptr.responseName);
              this.ptr.resolvedResponseType = res;
            } else if (!(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) && !(this.ptr instanceof ProtoBuf.Reflect.Extension) && !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value)) throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
            return this.reset();
          };
          BuilderPrototype.build = function(path) {
            this.reset();
            this.resolved || (this.resolveAll(), this.resolved = true, this.result = null);
            null === this.result && (this.result = this.ns.build());
            if (!path) return this.result;
            var part = "string" === typeof path ? path.split(".") : path, ptr = this.result;
            for (var i = 0; i < part.length; i++) {
              if (!ptr[part[i]]) {
                ptr = null;
                break;
              }
              ptr = ptr[part[i]];
            }
            return ptr;
          };
          BuilderPrototype.lookup = function(path, excludeNonNamespace) {
            return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;
          };
          BuilderPrototype.toString = function() {
            return "Builder";
          };
          Builder.Message = function() {};
          Builder.Enum = function() {};
          Builder.Service = function() {};
          return Builder;
        }(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);
        ProtoBuf.Map = function(ProtoBuf, Reflect) {
          var Map = function(field, contents) {
            if (!field.map) throw Error("field is not a map");
            this.field = field;
            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);
            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);
            this.map = {};
            Object.defineProperty(this, "size", {
              get: function() {
                return Object.keys(this.map).length;
              }
            });
            if (contents) {
              var keys = Object.keys(contents);
              for (var i = 0; i < keys.length; i++) {
                var key = this.keyElem.valueFromString(keys[i]);
                var val = this.valueElem.verifyValue(contents[keys[i]]);
                this.map[this.keyElem.valueToString(key)] = {
                  key: key,
                  value: val
                };
              }
            }
          };
          var MapPrototype = Map.prototype;
          function arrayIterator(arr) {
            var idx = 0;
            return {
              next: function() {
                if (idx < arr.length) return {
                  done: false,
                  value: arr[idx++]
                };
                return {
                  done: true
                };
              }
            };
          }
          MapPrototype.clear = function() {
            this.map = {};
          };
          MapPrototype["delete"] = function(key) {
            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
            var hadKey = keyValue in this.map;
            delete this.map[keyValue];
            return hadKey;
          };
          MapPrototype.entries = function() {
            var entries = [];
            var strKeys = Object.keys(this.map);
            for (var i = 0, entry; i < strKeys.length; i++) entries.push([ (entry = this.map[strKeys[i]]).key, entry.value ]);
            return arrayIterator(entries);
          };
          MapPrototype.keys = function() {
            var keys = [];
            var strKeys = Object.keys(this.map);
            for (var i = 0; i < strKeys.length; i++) keys.push(this.map[strKeys[i]].key);
            return arrayIterator(keys);
          };
          MapPrototype.values = function() {
            var values = [];
            var strKeys = Object.keys(this.map);
            for (var i = 0; i < strKeys.length; i++) values.push(this.map[strKeys[i]].value);
            return arrayIterator(values);
          };
          MapPrototype.forEach = function(cb, thisArg) {
            var strKeys = Object.keys(this.map);
            for (var i = 0, entry; i < strKeys.length; i++) cb.call(thisArg, (entry = this.map[strKeys[i]]).value, entry.key, this);
          };
          MapPrototype.set = function(key, value) {
            var keyValue = this.keyElem.verifyValue(key);
            var valValue = this.valueElem.verifyValue(value);
            this.map[this.keyElem.valueToString(keyValue)] = {
              key: keyValue,
              value: valValue
            };
            return this;
          };
          MapPrototype.get = function(key) {
            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
            if (!(keyValue in this.map)) return;
            return this.map[keyValue].value;
          };
          MapPrototype.has = function(key) {
            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
            return keyValue in this.map;
          };
          return Map;
        }(ProtoBuf, ProtoBuf.Reflect);
        ProtoBuf.loadProto = function(proto, builder, filename) {
          ("string" === typeof builder || builder && "string" === typeof builder["file"] && "string" === typeof builder["root"]) && (filename = builder, 
          builder = void 0);
          return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename);
        };
        ProtoBuf.protoFromString = ProtoBuf.loadProto;
        ProtoBuf.loadProtoFile = function(filename, callback, builder) {
          callback && "object" === typeof callback ? (builder = callback, callback = null) : callback && "function" === typeof callback || (callback = null);
          if (callback) return ProtoBuf.Util.fetch("string" === typeof filename ? filename : filename["root"] + "/" + filename["file"], function(contents) {
            if (null === contents) {
              callback(Error("Failed to fetch file"));
              return;
            }
            try {
              callback(null, ProtoBuf.loadProto(contents, builder, filename));
            } catch (e) {
              callback(e);
            }
          });
          var contents = ProtoBuf.Util.fetch("object" === typeof filename ? filename["root"] + "/" + filename["file"] : filename);
          return null === contents ? null : ProtoBuf.loadProto(contents, builder, filename);
        };
        ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile;
        ProtoBuf.newBuilder = function(options) {
          options = options || {};
          "undefined" === typeof options["convertFieldsToCamelCase"] && (options["convertFieldsToCamelCase"] = ProtoBuf.convertFieldsToCamelCase);
          "undefined" === typeof options["populateAccessors"] && (options["populateAccessors"] = ProtoBuf.populateAccessors);
          return new ProtoBuf.Builder(options);
        };
        ProtoBuf.loadJson = function(json, builder, filename) {
          ("string" === typeof builder || builder && "string" === typeof builder["file"] && "string" === typeof builder["root"]) && (filename = builder, 
          builder = null);
          builder && "object" === typeof builder || (builder = ProtoBuf.newBuilder());
          "string" === typeof json && (json = JSON.parse(json));
          builder["import"](json, filename);
          builder.resolveAll();
          return builder;
        };
        ProtoBuf.loadJsonFile = function(filename, callback, builder) {
          callback && "object" === typeof callback ? (builder = callback, callback = null) : callback && "function" === typeof callback || (callback = null);
          if (callback) return ProtoBuf.Util.fetch("string" === typeof filename ? filename : filename["root"] + "/" + filename["file"], function(contents) {
            if (null === contents) {
              callback(Error("Failed to fetch file"));
              return;
            }
            try {
              callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));
            } catch (e) {
              callback(e);
            }
          });
          var contents = ProtoBuf.Util.fetch("object" === typeof filename ? filename["root"] + "/" + filename["file"] : filename);
          return null === contents ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);
        };
        return ProtoBuf;
      });
    }).call(this, require("_process"));
  }, {
    _process: 2,
    bytebuffer: 3,
    fs: void 0,
    path: 1
  } ],
  GameController: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "35c3dAmmWBJKYaJ5dQiwC0t", "GameController");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var GameDataCenter_1 = require("../data/GameDataCenter");
    var Log_1 = require("./main/utils/Log");
    var WxCloudMng_1 = require("./manager/WxCloudMng");
    var DataUtil_1 = require("./main/utils/DataUtil");
    var PrefabPool_1 = require("./main/resource/PrefabPool");
    var UIHelp_1 = require("./main/ui/UIHelp");
    var TcbMng_1 = require("./manager/TcbMng");
    var GameController = function() {
      function GameController() {
        this.vidoeNum = 0;
        this.bannerAd = null;
        this.allCoinPos = {
          hallCoin: null
        };
      }
      GameController.prototype.init = function() {
        this.initData();
      };
      GameController.prototype.connetServer = function() {};
      GameController.prototype.initData = function() {
        var _this = this;
        new Promise(function(resolve, reject) {
          var KEY_IS_NEWER = "IS_NEWER";
          var isNewer = cc.sys.localStorage.getItem("" + KEY_IS_NEWER);
          if (isNewer) {
            UIHelp_1.default.ShowTips("\u6b22\u8fce\u56de\u6765!");
            TcbMng_1.default.init().then(function(res) {
              _this.getTimeDifference();
              resolve(null);
            }).catch(reject);
          } else {
            UIHelp_1.default.ShowTips("\u6b22\u8fce\u6765\u5230\u96ea\u5730\u51b2\u51b2\u51b2!");
            TcbMng_1.default.init().then(function(res) {
              return TcbMng_1.default.getData();
            }).then(function(res) {
              _this.getTimeDifference();
              resolve(null);
            }).catch(reject);
          }
        }).then(function(res) {
          WxCloudMng_1.default.initWx();
        }).catch(function(e) {
          WxCloudMng_1.default.initWx();
          cc.error(e);
        });
      };
      GameController.prototype.getTimeDifference = function(resolve, reject) {
        TcbMng_1.default.getServerTime().then(function(res) {
          var serverTime = Math.floor(res.result.data / 1e3);
          cc.log("server time", serverTime);
          DataUtil_1.default.timeDifference = serverTime - DataUtil_1.default.getNowDateStemp();
          resolve && resolve();
        }).catch(function(e) {
          Log_1.Log.error(e);
          reject && reject(e);
        });
      };
      GameController.prototype.initCommonPool = function() {
        var prefabArr = [];
        prefabArr.forEach(function(url, i) {
          setTimeout(function() {
            PrefabPool_1.PrefabPoolMgr.initPrefabPoolAsync(url);
          }, 500 * i);
        });
        var index = 0;
        initPool(new Promise(function(resolve) {
          Log_1.Log.log("\u5f00\u59cb\u4e0b\u8f7d");
          resolve(null);
        }));
        function initPool(promis) {
          index < prefabArr.length && promis.then(function() {
            index++;
            initPool(PrefabPool_1.PrefabPoolMgr.initPrefabPoolAsync(prefabArr[index - 1]));
          }).catch(function(err) {
            Log_1.Log.error(err);
            initPool(PrefabPool_1.PrefabPoolMgr.initPrefabPoolAsync(prefabArr[index - 1]));
          });
        }
      };
      GameController.prototype.playVideoAd = function() {
        var _this = this;
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
        WxCloudMng_1.default.hideGameClub();
        var success, error, cancel, isLong, evntName;
        var i = 0;
        if (args[i]) {
          if ("function" == typeof args[i]) {
            success = args[i];
            i++;
          }
          if ("function" == typeof args[i] && "function" == typeof args[i + 1]) {
            error = args[i];
            i++;
            cancel = args[i];
            i++;
          } else if ("function" == typeof args[i]) {
            cancel = args[i];
            i++;
          }
          if ("boolean" == typeof args[i]) {
            isLong = args[i];
            i++;
          }
          if ("string" == typeof args[i]) {
            evntName = args[i];
            i++;
          }
        }
        this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u5f00\u59cb-" + evntName);
        this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u5f00\u59cb-\u603b\u8ba1");
        if (error) {
          var oldError_1 = error;
          error = function() {
            _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u5931\u8d25-" + evntName);
            oldError_1();
            GameDataCenter_1.default.system.is_open_sound = true;
          };
        } else error = function() {
          UIHelp_1.default.ShowTips("\u672a\u80fd\u62c9\u53d6\u5230\u5408\u9002\u7684\u5e7f\u544a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5!");
          _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u5931\u8d25-" + evntName);
          GameDataCenter_1.default.system.is_open_sound = true;
        };
        if (cancel) {
          var oldCancel_1 = cancel;
          cancel = function() {
            _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u53d6\u6d88-" + evntName, {
              "\u5e7f\u544a\u65f6\u95f4": isLong ? "\u957f" : "\u77ed"
            });
            oldCancel_1();
            GameDataCenter_1.default.system.is_open_sound = true;
          };
        } else cancel = function() {
          UIHelp_1.default.ShowTips("\u770b\u89c6\u9891\u4e2d\u9014\u5173\u95ed\uff0c\u4e0d\u80fd\u83b7\u53d6\u5956\u52b1\u5594!");
          _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u53d6\u6d88-" + evntName, {
            "\u5e7f\u544a\u65f6\u95f4": isLong ? "\u957f" : "\u77ed"
          });
          GameDataCenter_1.default.system.is_open_sound = true;
        };
        var oldSuccess = success;
        success = function() {
          oldSuccess();
          GameDataCenter_1.default.system.is_open_sound = true;
          _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u6210\u529f-" + evntName);
          _this.PostCustomEvt("\u64ad\u653e\u89c6\u9891\u6210\u529f-\u603b\u8ba1");
        };
        GameDataCenter_1.default.system.is_open_sound = false;
        if (false, cc.sys.platform === cc.sys.DESKTOP_BROWSER) {
          success();
          WxCloudMng_1.default.showGameClub();
        } else cc.sys.platform === cc.sys.WECHAT_GAME && WxCloudMng_1.default.playVideoAd(success, error, cancel, isLong);
      };
      GameController.prototype.shareGame = function() {
        var _this = this;
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
        var title, query, imgUrl, success, cancel;
        var i = 0;
        if (args[i]) {
          if ("string" == typeof args[i]) {
            title = args[i];
            i++;
          }
          if ("string" == typeof args[i]) {
            imgUrl = args[i];
            i++;
          }
          if ("string" == typeof args[i]) {
            query = args[i];
            i++;
          }
          if ("function" == typeof args[i]) {
            success = args[i];
            i++;
          }
          if ("function" == typeof args[i]) {
            cancel = args[i];
            i++;
          }
        }
        if (cancel) {
          var oldCancel_2 = cancel;
          cancel = function() {
            _this.PostCustomEvt("\u5224\u5b9a\u5206\u4eab\u5931\u8d25", {
              "\u6807\u9898": title
            });
            oldCancel_2();
          };
        } else cancel = function() {
          UIHelp_1.default.ShowTips("\u5206\u4eab\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!");
          _this.PostCustomEvt("\u5224\u5b9a\u5206\u4eab\u5931\u8d25", {
            "\u6807\u9898": title
          });
        };
        var oldSuccess = success;
        success = function() {
          oldSuccess();
          _this.PostCustomEvt("\u5224\u5b9a\u5206\u4eab\u6210\u529f", {
            "\u6807\u9898": title
          });
        };
        false, cc.sys.platform === cc.sys.DESKTOP_BROWSER ? success() : cc.sys.platform === cc.sys.WECHAT_GAME && WxCloudMng_1.default.shareMessage(title, imgUrl, query, success, cancel);
      };
      GameController.prototype.PostCustomEvt = function(evtName, p1) {
        cc.sys.platform === cc.sys.WECHAT_GAME && wx.aldSendEvent && wx.aldSendEvent(evtName, p1);
      };
      GameController.prototype.ShowBanner = function() {
        var _this = this;
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
          this.DestroyBanner();
          if (null == this.bannerAd) {
            var windowWidth_1 = wx.getSystemInfoSync().windowWidth;
            var windowHeight_1 = wx.getSystemInfoSync().windowHeight;
            cc.log("w = ", windowWidth_1, "h = ", windowHeight_1);
            this.bannerAd = wx.createBannerAd({
              adUnitId: "adunit-3ec3b8d2552092dd",
              adIntervals: 30,
              style: {
                left: 0,
                top: 0,
                width: 300,
                height: 40
              }
            });
            this.bannerAd.onError(function(err) {
              cc.log(err);
              1004 == err.errCode && _this.PostCustomEvt("banner\u5e7f\u544a - \u6ca1\u6709\u5408\u9002\u5e7f\u544a");
            });
            this.bannerAd.onResize(function() {
              _this.bannerAd.style.left = windowWidth_1 / 2 - _this.bannerAd.style.realWidth / 2 + .1;
              _this.bannerAd.style.top = windowHeight_1 - _this.bannerAd.style.realHeight + .1;
            });
          }
          this.bannerAd.show();
        }
      };
      GameController.prototype.DestroyBanner = function() {
        cc.sys.platform === cc.sys.WECHAT_GAME && this.bannerAd && this.bannerAd.hide();
      };
      return GameController;
    }();
    exports.default = new GameController();
    cc._RF.pop();
  }, {
    "../data/GameDataCenter": "GameDataCenter",
    "./main/resource/PrefabPool": "PrefabPool",
    "./main/ui/UIHelp": "UIHelp",
    "./main/utils/DataUtil": "DataUtil",
    "./main/utils/Log": "Log",
    "./manager/TcbMng": "TcbMng",
    "./manager/WxCloudMng": "WxCloudMng"
  } ],
  GameDataCenter: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "e9a5c9zLT9HHJCmWhskWYm7", "GameDataCenter");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var AccountModel_1 = require("../commonLib/model/Account/AccountModel");
    var SystemModel_1 = require("../commonLib/model/System/SystemModel");
    var SingletonFactory_1 = require("../commonLib/main/utils/SingletonFactory");
    var GameDataCenter = function() {
      function GameDataCenter() {
        this._tModel = [];
        this.account = null;
        this.system = null;
        false;
      }
      GameDataCenter.prototype.newModel = function(c) {
        var obj = SingletonFactory_1.SingletonFactory.getInstance(c);
        this._tModel.push(obj);
        return obj;
      };
      GameDataCenter.prototype.clear = function() {
        this._tModel.forEach(function(m) {
          m.clear();
        });
        SingletonFactory_1.SingletonFactory.clear();
      };
      GameDataCenter.prototype.initModule = function() {
        this.account = this.newModel(AccountModel_1.default);
        this.account.Init();
        this.system = this.newModel(SystemModel_1.default);
      };
      return GameDataCenter;
    }();
    exports.default = new GameDataCenter();
    cc._RF.pop();
  }, {
    "../commonLib/main/utils/SingletonFactory": "SingletonFactory",
    "../commonLib/model/Account/AccountModel": "AccountModel",
    "../commonLib/model/System/SystemModel": "SystemModel"
  } ],
  GameMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "33daaD4OotAPaJptIy8iPCI", "GameMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var UIMng_1 = require("../../../commonLib/manager/UIMng");
    var UIGameOver_1 = require("../gameOver/UIGameOver");
    var GameMng = function() {
      function GameMng() {
        this.firstRun = false;
        this.aPowerUpBarData = new Array(0, 0, 0, 0);
        this._isinitedEvent = false;
        this.touchingID = 0;
        this._isSended = false;
        this._touchKey = "";
      }
      GameMng.prototype.initGame = function() {
        this.gameState = "game";
        this.background.renderState = "game";
        this._initEvent();
        this.endGameSequence = false;
        this.aEffects = new Array();
        this.previousTime = new Date().getTime();
        this.updateGameEvent();
        this.squirrel.init();
        this.branch.init();
      };
      GameMng.prototype._onPlayerSteerKey = function(event) {
        var _a;
        var map = (_a = {}, _a[cc.macro.KEY.up] = "keyUp", _a[cc.macro.KEY.down] = "keyDown", 
        _a[cc.macro.KEY.left] = "steerKeyLeft", _a[cc.macro.KEY.right] = "steerKeyRight", 
        _a);
        var key = map[event.keyCode];
        this.butEventHandler(key, {
          isDown: "keydown" == event.type
        });
      };
      GameMng.prototype._initEvent = function() {
        if (this._isinitedEvent) return;
        this._isinitedEvent = true;
        cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this._onPlayerSteerKey, this);
        cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this._onPlayerSteerKey, this);
        this.canvas.on(cc.Node.EventType.TOUCH_START, this.onTouchEvt, this);
        this.canvas.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMoveEvt, this);
        this.canvas.on(cc.Node.EventType.TOUCH_END, this.onTouchEvt, this);
      };
      GameMng.prototype.onTouchEvt = function(evt) {
        var touch = evt.touch;
        var tid = touch.getID();
        var touchingID = this.touchingID;
        if (evt.type === cc.Node.EventType.TOUCH_START) {
          if (touchingID) return;
          touchingID = tid;
        } else {
          if (touchingID && touchingID !== tid) return;
          if (this._isSended) {
            this._isSended = false;
            this.butEventHandler(this._touchKey, {
              isDown: false
            });
          }
          this.touchingID = 0;
        }
      };
      GameMng.prototype.onTouchMoveEvt = function(evt) {
        var touch = evt.touch;
        var tid = touch.getID();
        var touchingID = this.touchingID;
        if (touchingID && touchingID !== tid) return;
        var vec = touch.getLocation().sub(touch.getStartLocation());
        if (vec.mag() < 10) return;
        if (!this._isSended) {
          this._isSended = true;
          var dir = this.getVecDir(vec);
          var key = "";
          key = dir.x ? 1 == dir.x ? "steerKeyRight" : "steerKeyLeft" : 1 == dir.y ? "keyUp" : "keyDown";
          this._touchKey = key;
          this.butEventHandler(key, {
            isDown: true
          });
        }
      };
      GameMng.prototype.getVecDir = function(vec) {
        return Math.abs(vec.x) > Math.abs(vec.y) ? vec.x > 0 ? cc.Vec2.RIGHT : cc.Vec2.RIGHT.negSelf() : vec.y > 0 ? cc.Vec2.UP : cc.Vec2.UP.negSelf();
      };
      GameMng.prototype.butEventHandler = function(G, O) {
        switch (G) {
         case "startGame":
          this.initGame();
          break;

         case "steerKeyRight":
          if (O.isDown) {
            this.squirrel.turn("right");
            this.firstRun && 0 == this.hud.tutState && (this.hasHorizAction = true);
          } else this.squirrel.allowRight = true;
          break;

         case "steerKeyLeft":
          if (O.isDown) {
            this.squirrel.turn("left");
            this.firstRun && 0 == this.hud.tutState && (this.hasHorizAction = true);
          } else this.squirrel.allowLeft = true;
          break;

         case "swipe":
          break;

         case "keyUp":
          if (O.isDown) {
            this.squirrel.jump();
            this.firstRun && 1 == this.hud.tutState && (this.hasVertAction = true);
          }
          break;

         case "keyDown":
          if (O.isDown) {
            this.squirrel.duck();
            this.firstRun && 1 == this.hud.tutState && (this.hasVertAction = true);
          }
          break;

         case "playFromEnd":
          this.initGame();
          break;

         case "backFromUpgrade":
          this.initGameEnd();
          break;

         case "playFromUpgrade":
          this.initGame();
          break;

         case "mute":
          break;

         case "pause":
         case "resumeFromPause":
          break;

         case "quitFromPause":
          this.levelScore = 0;
          this.totalScore = 0;
        }
      };
      GameMng.prototype.initGameEnd = function() {
        this.gameState = "gameOver";
        this.background.renderState = "menuScroll";
        this.previousTime = new Date().getTime();
        UIMng_1.default.openUI(UIGameOver_1.default);
      };
      GameMng.prototype.gemEvent = function(G) {
        G > 0 && this.hud.collectGem();
      };
      GameMng.prototype.powerUpEvent = function(G) {
        switch (G) {
         case 0:
          this.squirrel.powerUpState = "invincible";
          this.squirrel.powerUpTimer = 10;
          break;

         case 1:
          this.squirrel.powerUpState = "magnet";
          this.squirrel.powerUpTimer = 10;
          break;

         case 2:
          this.squirrel.powerUpState = "gems";
          this.squirrel.powerUpTimer = 5;
        }
      };
      GameMng.prototype.endGameEvent = function(G) {
        var _this = this;
        this.endGameSequence = true;
        TweenMax.to(this.branch, 1, {
          scrollSpeed: 0,
          ease: "Quad.easeOut",
          onComplete: function() {
            _this.initGameEnd();
          }
        });
        switch (G) {
         case "fall":
          this.squirrel.fallOff();
          break;

         case "block":
          this.squirrel.hitBlock();
          this.branch.scrollSpeed = 0;
        }
      };
      GameMng.prototype.addParticle = function(G, O, d) {};
      GameMng.prototype.updateGameEvent = function() {};
      GameMng.prototype.getDelta = function() {
        var G = new Date().getTime(), O = (G - this.previousTime) / 1e3;
        this.previousTime = G;
        O > .5 && (O = 0);
        return O;
      };
      return GameMng;
    }();
    exports.GameMng = GameMng;
    var gameMng = new GameMng();
    false;
    exports.default = gameMng;
    cc._RF.pop();
  }, {
    "../../../commonLib/manager/UIMng": "UIMng",
    "../gameOver/UIGameOver": "UIGameOver"
  } ],
  GodCommand: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "c169bytmm9MH4v26IPKf9RD", "GodCommand");
    "use strict";
    var async = require("async");
    var GodCommand = {
      locator: function locator(godGuide, step, callback) {
        var args = step.command.args;
        godGuide.find(args, function(node) {
          godGuide._targetNode = node;
          node.once(cc.Node.EventType.TOUCH_END, function() {
            cc.log("\u8282\u70b9\u88ab\u70b9\u51fb");
            callback();
          });
          var autorun = godGuide.getTask().autorun;
          autorun && godGuide.touchSimulation(node);
        });
      },
      finger: function finger(godGuide, step, callback) {
        var _step$command = step.command, args = _step$command.args, unLock = _step$command.unLock;
        godGuide._targetNode = null;
        godGuide.find(args, function(error, node) {
          if (error) {
            cc.log("\u627e\u4e0d\u5230\u8282\u70b9\u8df3\u5230\u4e0b\u4e00\u6b65");
            callback();
            return;
          }
          step.txt && godGuide.showText(step.txt, function() {});
          if (unLock) {
            godGuide.node.getChildByName("mask").getChildByName("bg").opacity = 0;
            godGuide.fingerToNode(node, function() {
              godGuide._targetNode = node;
              node.once(cc.Node.EventType.TOUCH_END, function() {
                cc.log("\u8282\u70b9\u88ab\u70b9\u51fb");
                godGuide.node._touchListener.setSwallowTouches(true);
                godGuide.isUnLock = false;
                godGuide.node.getChildByName("mask").getChildByName("bg").opacity = 50;
                godGuide._finger.active = false;
                godGuide._finger.parent = godGuide.node;
                callback();
              });
            }, unLock);
          } else godGuide.fingerToNode(node, function() {
            godGuide._targetNode = node;
            node.once(cc.Node.EventType.TOUCH_END, function() {
              cc.log("\u8282\u70b9\u88ab\u70b9\u51fb");
              callback();
            });
          });
          var autorun = godGuide.getTask().autorun;
          autorun && godGuide.touchSimulation(node);
        }, null, step.getRoot);
      },
      fingerMove: function fingerMove(godGuide, step, callback) {
        var _step$command2 = step.command, args = _step$command2.args, start = _step$command2.start, end = _step$command2.end, rectCfg = _step$command2.rectCfg, flagArea = _step$command2.flagArea;
        godGuide._targetNode = null;
        null == flagArea && (flagArea = 100);
        godGuide.find(args, function(error, node) {
          if (error) {
            cc.log("\u627e\u4e0d\u5230\u8282\u70b9\u8df3\u5230\u4e0b\u4e00\u6b65");
            callback();
            return;
          }
          start = node.convertToWorldSpaceAR(cc.v2(start.x, start.y));
          end = node.convertToWorldSpaceAR(cc.v2(end.x, end.y));
          godGuide.fingerToNodeMove(start, end, function() {
            godGuide._targetNode = node;
            godGuide._targetNode.on(cc.Node.EventType.TOUCH_END, flag, godGuide);
            function flag(event) {
              if (Math.abs(event.touch._point.x - end.x) < flagArea && Math.abs(event.touch._point.y - end.y) < flagArea && Math.abs(event.touch._startPoint.x - start.x) < flagArea && Math.abs(event.touch._startPoint.y - start.y) < flagArea) {
                cc.log("\u8282\u70b9\u88ab\u70b9\u51fb");
                callback();
                godGuide._targetNode.off(cc.Node.EventType.TOUCH_END, flag, godGuide);
              } else if (step.otherFlag && step.otherFlag()) {
                cc.log("\u8282\u70b9\u88ab\u70b9\u51fb");
                callback();
                godGuide._targetNode.off(cc.Node.EventType.TOUCH_END, flag, godGuide);
              }
            }
          });
          var autorun = godGuide.getTask().autorun;
          autorun && godGuide.touchSimulationMove(start, end);
        }, rectCfg);
      },
      autotext: function autotext(godGuide, step, callback) {
        var args = step.command.args;
        !args || "string" !== typeof args && "number" !== typeof args || (args = [ args ]);
        var autorun = godGuide.getTask().autorun;
        var index = 0;
        godGuide._targetNode = null;
        async.eachSeries(args, function(str, cb) {
          var flag = false;
          godGuide.showText(str, function() {
            if (flag) return;
            flag = true;
          });
          index++ >= args.length - 1 && (flag = true);
          true;
          setTimeout(function() {
            flag = true;
            cb();
          }, 1e3);
        }, callback);
      },
      text: function text(godGuide, step, callback) {
        var args = step.command.args;
        !args || "string" !== typeof args && "number" !== typeof args || (args = [ args ]);
        var autorun = godGuide.getTask().autorun;
        var index = 0;
        godGuide._targetNode = null;
        async.eachSeries(args, function(str, cb) {
          var flag = false;
          godGuide.showText(str, function() {
            if (flag) return;
            flag = true;
            cb();
          });
          if (index++ >= args.length - 1) {
            flag = true;
            cb();
            return;
          }
          autorun && setTimeout(function() {
            if (flag) return;
            flag = true;
            cb();
          }, 1e3);
        }, callback);
      }
    };
    GodCommand.LOCATOR = "locator";
    GodCommand.FINGER = "finger";
    GodCommand.TEXT = "text";
    GodCommand.AUTOTEXT = "autotext";
    module.exports = GodCommand;
    cc._RF.pop();
  }, {
    async: "async"
  } ],
  GodGuide: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7b174OZGvJOjZrsLqOTxm98", "GodGuide");
    "use strict";
    var async = require("async");
    var locator = require("locator");
    var godCommand = require("GodCommand");
    var RADIAN = 2 * Math.PI / 360;
    function getRotatePoint(p, angle, center) {
      var out = cc.v2();
      var radian = -angle * RADIAN;
      out.x = (p.x - center.x) * Math.cos(radian) - (p.y - center.y) * Math.sin(radian) + center.x;
      out.y = (p.x - center.x) * Math.sin(radian) + (p.y - center.y) * Math.cos(radian) + center.y;
      return out;
    }
    function getRectRotatePoints(rect, angle, pt) {
      var array = [ cc.v2(rect.x, rect.y), cc.v2(rect.x + rect.width, rect.y), cc.v2(rect.x + rect.width, rect.y + rect.height), cc.v2(rect.x, rect.y + rect.height) ];
      return array.map(function(p) {
        return getRotatePoint(p, angle, pt);
      });
    }
    function getHTMLElementPosition(element) {
      var docElem = document.documentElement;
      var leftOffset = window.pageXOffset - docElem.clientLeft;
      var topOffset = window.pageYOffset - docElem.clientTop;
      if ("function" === typeof element.getBoundingClientRect) {
        var box = element.getBoundingClientRect();
        return {
          left: box.left + leftOffset,
          top: box.top + topOffset,
          width: box.width,
          height: box.height
        };
      }
      return element instanceof HTMLCanvasElement ? {
        left: leftOffset,
        top: topOffset,
        width: element.width,
        height: element.height
      } : {
        left: leftOffset,
        top: topOffset,
        width: parseInt(element.style.width),
        height: parseInt(element.style.height)
      };
    }
    function _touchSimulation(x, y) {
      var rect;
      var inputManager = window["_cc"].inputManager;
      if (cc.sys.isBrowser) {
        var canvas = document.getElementById("GameCanvas");
        rect = getHTMLElementPosition(canvas);
      } else {
        rect = cc.view.getFrameSize();
        rect.left = 0;
        rect.top = 0;
      }
      var vp = cc.view.getViewportRect();
      var sx = cc.view.getScaleX();
      var sy = cc.view.getScaleY();
      var ratio = cc.view.getDevicePixelRatio();
      var htmlx = (x * sx + vp.x) / ratio + rect.left;
      var htmly = rect.top + rect.height - (y * sy + vp.y) / ratio;
      var pt = cc.v2(htmlx, htmly);
      cc.log("\u6a21\u62df\u70b9\u51fb\u5750\u6807\uff1a".concat(pt.x, ", ").concat(pt.y));
      var touch = inputManager.getTouchByXY(pt.x, pt.y, rect);
      inputManager.handleTouchesBegin([ touch ]);
      setTimeout(function() {
        inputManager.handleTouchesEnd([ touch ]);
      }, 200);
    }
    function _touchSimulationMove(x1, y1, x2, y2) {
      var rect;
      var inputManager = window["_cc"].inputManager;
      if (cc.sys.isBrowser) {
        var canvas = document.getElementById("GameCanvas");
        rect = getHTMLElementPosition(canvas);
      } else {
        rect = cc.view.getFrameSize();
        rect.left = 0;
        rect.top = 0;
      }
      var vp = cc.view.getViewportRect();
      var sx = cc.view.getScaleX();
      var sy = cc.view.getScaleY();
      var ratio = cc.view.getDevicePixelRatio();
      var htmlx1 = (x1 * sx + vp.x) / ratio + rect.left;
      var htmly1 = rect.top + rect.height - (y1 * sy + vp.y) / ratio;
      var pt1 = cc.v2(htmlx1, htmly1);
      var htmlx2 = (x2 * sx + vp.x) / ratio + rect.left;
      var htmly2 = rect.top + rect.height - (y2 * sy + vp.y) / ratio;
      var pt2 = cc.v2(htmlx2, htmly2);
      cc.log("\u6a21\u62df\u70b9\u51fb\u5750\u6807\uff1a".concat(pt1.x, ", ").concat(pt1.y));
      var touch = inputManager.getTouchByXY(pt1.x, pt1.y, rect);
      var touchEnd = inputManager.getTouchByXY(pt2.x, pt2.y, rect);
      inputManager.handleTouchesBegin([ touch ]);
      setTimeout(function() {
        inputManager.handleTouchesEnd([ touchEnd ]);
      }, 1e3);
    }
    var GodGuide = cc.Class({
      extends: cc.Component,
      properties: {
        _selector: "",
        selector: {
          get: function get() {
            return this._selector;
          },
          set: function set(value) {
            this._selector = value;
            this.find(value);
          }
        },
        type: {
          default: cc.Mask.Type.RECT,
          type: cc.Mask.Type
        },
        FINGER_PREFAB: cc.Prefab,
        TEXT_PREFAB: cc.Prefab,
        isUnLock: false
      },
      statics: {
        find: function find(path, cb) {
          var root = cc.find("Canvas");
          locator.locateNode(root, path, cb);
        }
      },
      onLoad: function onLoad() {
        this.init();
        window.GodGuide = this;
      },
      touchSimulation: function touchSimulation(node) {
        this.log("\u81ea\u52a8\u6267\u884c\uff0c\u6a21\u62df\u89e6\u6478");
        if (!node) {
          cc.log("\u8282\u70b9\u4e0d\u5b58\u5728 \u8df3\u8fc7\u89e6\u6478");
          return;
        }
        this.scheduleOnce(function() {
          cc.log("\u81ea\u52a8\u8282\u70b9 :", JSON.stringify(node.position));
          var p = node.parent.convertToWorldSpaceAR(node.position);
          cc.log("\u4e16\u754c\u8282\u70b9 :", JSON.stringify(p));
          _touchSimulation(p.x, p.y);
        }, 1);
      },
      touchSimulationMove: function touchSimulationMove(start, end) {
        this.log("\u81ea\u52a8\u6267\u884c\uff0c\u6a21\u62df\u6ed1\u52a8");
        this.scheduleOnce(function() {
          cc.log("\u4e16\u754c\u8282\u70b9 \u5f00\u59cb:", JSON.stringify(start));
          cc.log("\u4e16\u754c\u8282\u70b9 \u76ee\u6807:", JSON.stringify(end));
          _touchSimulationMove(start.x, start.y, end.x, end.y);
        }, 1);
      },
      init: function init() {
        var _this = this;
        this.node.setContentSize(cc.winSize);
        this._targetNode = null;
        if (this.FINGER_PREFAB) {
          this._finger = cc.instantiate(this.FINGER_PREFAB);
          this._finger.parent = this.node;
          this._finger.active = false;
        }
        if (this.TEXT_PREFAB) {
          this._text = cc.instantiate(this.TEXT_PREFAB);
          this._text.parent = this.node;
          this._text.active = false;
        }
        this._debugNode = this.node.getChildByName("debug");
        this._autorun = cc.find("autorun/Background/Label", this._debugNode).getComponent(cc.Label);
        this._autorun.string = "\u81ea\u52a8\u5f15\u5bfc\uff08\u5173\uff09";
        this._mask = this.node.getComponentInChildren(cc.Mask);
        this._mask.inverted = true;
        this._mask.node.active = false;
        this.node.on(cc.Node.EventType.TOUCH_START, function(event) {
          if (_this.isUnLock) {
            _this.node._touchListener.setSwallowTouches(false);
            cc.log("\u4e0d\u9501\u5b9a\u6a21\u5f0f\uff0c\u653e\u884c");
            return;
          }
          if (_this._dispatchEvent) {
            _this.node._touchListener.setSwallowTouches(false);
            return;
          }
          if (!_this._mask.node.active) {
            _this.node._touchListener.setSwallowTouches(false);
            return;
          }
          if (!_this._targetNode) {
            _this.node._touchListener.setSwallowTouches(true);
            return;
          }
          var rect = _this._targetNode.getBoundingBoxToWorld();
          var uimain = MainSceneMng.instance.getComponent("UIMain");
          var camera = uimain.ui.RoadCamera.getComponent(cc.Camera);
          var pos = camera.getWorldToScreenPoint(rect.origin);
          var camera2 = uimain.ui.Camera.getComponent(cc.Camera);
          var pos2 = camera2.getScreenToWorldPoint(pos);
          var p = pos2;
          rect.x = p.x;
          rect.y = p.y;
          if (rect.contains(event.getLocation())) {
            _this.node._touchListener.setSwallowTouches(false);
            cc.log("\u547d\u4e2d\u76ee\u6807\u8282\u70b9\uff0c\u653e\u884c");
          } else {
            _this.node._touchListener.setSwallowTouches(true);
            cc.log("\u672a\u547d\u4e2d\u76ee\u6807\u8282\u70b9\uff0c\u62e6\u622a");
          }
        }, this);
      },
      start: function start() {
        cc.debug.setDisplayStats(false);
      },
      setTask: function setTask(task) {
        if (this._task) {
          cc.warn("\u5f53\u524d\u4efb\u52a1\u8fd8\u672a\u5904\u7406\u5b8c\u6bd5\uff01");
          return;
        }
        this._debugNode.active = !!task.debug;
        this._autorun.string = "\u81ea\u52a8\u5f15\u5bfc(".concat(task.autorun ? "\u5f00" : "\u5173", "\uff09");
        this._task = task;
      },
      getTask: function getTask() {
        return this._task;
      },
      run: function run(callback) {
        var _this2 = this;
        if (!this._task) return;
        async.eachSeries(this._task.steps, function(step, cb) {
          _this2._processStep(step, cb);
        }, function() {
          _this2._task = null;
          cc.log("\u4efb\u52a1\u7ed3\u675f");
          _this2._mask.node.active = false;
          _this2._finger && (_this2._finger.active = false);
          callback && callback();
        });
      },
      fillPoints: function fillPoints(points) {
        var _this3 = this;
        var p0 = points[0];
        this._mask._graphics.moveTo(p0.x, p0.y);
        points.slice(1).forEach(function(p) {
          _this3._mask._graphics.lineTo(p.x, p.y);
        });
        this._mask._graphics.lineTo(p0.x, p0.y);
        this._mask._graphics.stroke();
        this._mask._graphics.fill();
      },
      _processStep: function _processStep(step, callback) {
        var _this4 = this;
        async.series({
          stepStart: function stepStart(cb) {
            GameController.PostCustomEvt("\u5f15\u5bfc-".concat(step.desc, "\u5f00\u59cb"));
            step.onStart ? step.onStart(function() {
              cb();
            }) : cb();
          },
          stepCommand: function stepCommand(cb) {
            _this4._mask.node.active = _this4._task.mask || true;
            _this4.scheduleOnce(function() {
              _this4._processStepCommand(step, function() {
                cb();
              });
            }, step.delayTime || 0);
          },
          taskEnd: function taskEnd(cb) {
            _this4._mask._graphics.clear();
            _this4._finger.active = false;
            GameController.PostCustomEvt("\u5f15\u5bfc-".concat(step.desc, "\u7ed3\u675f"));
            step.onEnd ? step.onEnd(function() {
              cb();
            }) : cb();
          }
        }, function(error) {
          _this4.log("\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u7ed3\u675f\uff01"));
          callback();
        });
      },
      fingerToNode: function fingerToNode(node, cb) {
        var _this5 = this;
        var isUnLock = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
        this._finger || cb();
        this.isUnLock = isUnLock;
        if (isUnLock) {
          this._finger.stopAllActions();
          this._finger.parent = node;
          this._finger.position = cc.v2(0, 30);
          this._finger.active = true;
          var _p = this._finger.position;
          var moveTo1 = cc.moveTo(.5, cc.v2(_p.x - 5, _p.y - 30));
          var moveTo2 = cc.moveTo(.25, _p).easing(cc.easeSineOut());
          var delay = cc.delayTime(.2);
          var _sequnce = cc.sequence(moveTo1, delay, moveTo2);
          var rep = cc.repeat(_sequnce, 999);
          this._finger.runAction(rep);
          cb();
        } else {
          this._finger.stopAllActions();
          this._finger.active = true;
          var oldP = node.parent.convertToWorldSpaceAR(node.position);
          var uimain = MainSceneMng.instance.getComponent("UIMain");
          var camera = uimain.ui.RoadCamera.getComponent(cc.Camera);
          var pos = camera.getWorldToScreenPoint(oldP);
          var camera2 = uimain.ui.Camera.getComponent(cc.Camera);
          var pos2 = camera2.getScreenToWorldPoint(pos);
          var p = this.node.convertToNodeSpaceAR(pos2);
          var duration = p.sub(this._finger.position).mag() / cc.winSize.height;
          var moveTo = cc.moveTo(duration, p);
          var callFunc = cc.callFunc(function() {
            var moveTo1 = cc.moveTo(.5, cc.v2(p.x - 5, p.y - 30));
            var moveTo2 = cc.moveTo(.25, p).easing(cc.easeSineOut());
            var delay = cc.delayTime(.2);
            var sequnce = cc.sequence(moveTo1, delay, moveTo2);
            var rep = cc.repeat(sequnce, 999);
            _this5._finger.runAction(rep);
            cb();
          });
          var sequnce = cc.sequence(moveTo, callFunc);
          this._finger.runAction(sequnce);
        }
      },
      fingerToNodeMove: function fingerToNodeMove(start, end, cb) {
        var _this6 = this;
        this._finger || cb();
        this._finger.stopAllActions();
        this._finger.active = true;
        var p1 = this.node.convertToNodeSpaceAR(start);
        var p2 = this.node.convertToNodeSpaceAR(end);
        var duration1 = p1.sub(this._finger.position).mag() / cc.winSize.height;
        var moveTo = cc.moveTo(duration1, p1);
        var callFunc = cc.callFunc(function() {
          var moveTo1 = cc.moveTo(.8, p2);
          var moveTo2 = cc.moveTo(.4, p1).easing(cc.easeSineOut());
          var delay = cc.delayTime(.2);
          var sequnce = cc.sequence(moveTo1, delay, moveTo2);
          var rep = cc.repeat(sequnce, 999);
          _this6._finger.runAction(rep);
          cb();
        });
        var sequnce = cc.sequence(moveTo, callFunc);
        this._finger.runAction(sequnce);
      },
      log: function log(text) {
        this._task.debug && cc.log(text);
      },
      _processStepCommand: function _processStepCommand(step, cb) {
        var _this7 = this;
        var cmd = godCommand[step.command.cmd];
        if (cmd) {
          this.log("\u6267\u884c\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd));
          GameController.PostCustomEvt("\u5f15\u5bfc-".concat(step.desc, "\u8fdb\u884c"), {
            "\u6307\u4ee4": "\u6267\u884c\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd)
          });
          cmd(this, step, function() {
            _this7.log("\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd, " \u6267\u884c\u5b8c\u6bd5"));
            GameController.PostCustomEvt("\u5f15\u5bfc-".concat(step.desc, "\u8fdb\u884c"), {
              "\u6307\u4ee4": "\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd, " \u6267\u884c\u5b8c\u6bd5")
            });
            cb();
          });
        } else {
          this.log("\u6267\u884c\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd, " \u4e0d\u5b58\u5728\uff01"));
          GameController.PostCustomEvt("\u5f15\u5bfc-".concat(step.desc, "\u8fdb\u884c"), {
            "\u6307\u4ee4": "\u6267\u884c\u6b65\u9aa4\u3010".concat(step.desc, "\u3011\u6307\u4ee4: ").concat(step.command.cmd, " \u4e0d\u5b58\u5728\uff01")
          });
          cb();
        }
      },
      find: function find(value, cb) {
        var _this8 = this;
        var rectCfg = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
        var getRoot = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null;
        var root = getRoot ? getRoot() : cc.find("Canvas");
        locator.locateNode(root, value, function(error, node) {
          if (error) {
            cc.log(error);
            cb(error);
            return;
          }
          cc.log("\u5b9a\u4f4d\u8282\u70b9\u6210\u529f");
          var rect = _this8._focusToNode(node, rectCfg);
          cb && cb(null, node, rect);
        });
      },
      locateNodeByEvent: function locateNodeByEvent(sender) {
        this.selector = sender.string;
      },
      getNodePoints: function getNodePoints(rect, angle, pt) {
        return getRectRotatePoints(rect, angle, pt).map(function(p) {
          return p;
        });
      },
      fillPolygon: function fillPolygon(points) {
        var _this9 = this;
        var p0 = points[0];
        this._mask._graphics.moveTo(p0.x, p0.y);
        points.slice(1).forEach(function(p) {
          _this9._mask._graphics.lineTo(p.x, p.y);
        });
        this._mask._graphics.lineTo(p0.x, p0.y);
        this._mask._graphics.stroke();
        this._mask._graphics.fill();
      },
      _focusToNode: function _focusToNode(node, rectCfg) {
        this._mask._graphics.clear();
        var rect = node.getBoundingBoxToWorld();
        var uimain = MainSceneMng.instance.getComponent("UIMain");
        var camera = uimain.ui.RoadCamera.getComponent(cc.Camera);
        var pos = camera.getWorldToScreenPoint(rect.origin);
        var camera2 = uimain.ui.Camera.getComponent(cc.Camera);
        var pos2 = camera2.getScreenToWorldPoint(pos);
        var p = this.node.convertToNodeSpaceAR(pos2);
        rect.x = p.x;
        rect.y = p.y;
        if (rectCfg) {
          rect.x += rectCfg.rectAnchor.x * rect.width;
          rect.y += rectCfg.rectAnchor.y * rect.height;
          rect.width *= rectCfg.widthPer;
          rect.height *= rectCfg.heightPer;
        }
        this._mask._graphics.fillRect(rect.x, rect.y, rect.width, rect.height);
        return rect;
      },
      getNodeFullPath: function getNodeFullPath(node) {
        var array = [];
        var temp = node;
        do {
          array.unshift(temp.name);
          temp = temp.parent;
        } while (temp && "Canvas" !== temp.name);
        return array.join("/");
      },
      isGuideNode: function isGuideNode(node) {
        var result = false;
        var temp = node;
        do {
          if (temp === this.node) {
            result = true;
            break;
          }
        } while (temp = temp.parent);
        return result;
      },
      startRecordNodeTouch: function startRecordNodeTouch() {
        if (this._task) {
          cc.warn("\u4efb\u52a1\u5f15\u5bfc\u4e2d\uff0c\u4e0d\u80fd\u5f55\u5236");
          return;
        }
        if (this._dispatchEvent) {
          cc.warn("\u5df2\u7ecf\u8fdb\u5165\u5f55\u5236\u6a21\u5f0f");
          return;
        }
        this._dispatchEvent = cc.Node.prototype.dispatchEvent;
        this._recordSteps = [];
        var self = this;
        var time = Date.now();
        var touchStartNode = null;
        cc.Node.prototype.dispatchEvent = function(event) {
          self._dispatchEvent.call(this, event);
          if (self.isGuideNode(this)) return;
          if (event.type === cc.Node.EventType.TOUCH_END) {
            var now = Date.now();
            var delayTime = (now - time) / 1e3;
            time = now;
            var args = self.getNodeFullPath(this);
            Math.abs(event.touch._point.x - event.touch._startPoint.x) > 50 || Math.abs(event.touch._point.y - event.touch._startPoint.y) > 50 ? self._recordSteps.push({
              desc: "\u6ed1\u52a8".concat(args),
              command: {
                cmd: "fingerMove",
                args: args,
                start: event.target.convertToNodeSpaceAR(event.touch._startPoint),
                end: event.target.convertToNodeSpaceAR(event.touch._point)
              },
              delayTime: delayTime
            }) : self._recordSteps.push({
              desc: "\u70b9\u51fb".concat(args),
              command: {
                cmd: "finger",
                args: args
              },
              delayTime: delayTime
            });
          }
        };
      },
      stopRecordNodeTouch: function stopRecordNodeTouch() {
        if (this._dispatchEvent) {
          cc.Node.prototype.dispatchEvent = this._dispatchEvent;
          this._dispatchEvent = null;
          cc.warn("\u9000\u51fa\u5f55\u5236\u72b6\u6001");
        } else cc.warn("\u672a\u8fdb\u5165\u5f55\u5236\u72b6\u6001");
      },
      playRecordNodeTouch: function playRecordNodeTouch(sender, autorun) {
        this.stopRecordNodeTouch();
        if (this._recordSteps && this._recordSteps.length) {
          cc.log("\u751f\u6210\u4efb\u52a1\uff1a", JSON.stringify(this._recordSteps));
          var task = {
            autorun: !!autorun,
            debug: true,
            steps: this._recordSteps
          };
          this._recordSteps = null;
          this.setTask(task);
          this.run();
        }
      },
      showText: function showText(text, callback) {
        this._text.once("click", callback);
        var godText = this._text.getComponent(this.TEXT_PREFAB.name);
        godText.text = text;
      },
      setAutorun: function setAutorun() {
        if (this._task) {
          this._task.autorun = !this._task.autorun;
          this._autorun.string = "\u81ea\u52a8\u5f15\u5bfc(".concat(this._task.autorun ? "\u5f00" : "\u5173", "\uff09");
        }
      }
    });
    module.exports = GodGuide;
    cc._RF.pop();
  }, {
    GodCommand: "GodCommand",
    async: "async",
    locator: "locator"
  } ],
  GodText: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "1b86czsmlRMTrELH2M+lvr8", "GodText");
    "use strict";
    cc.Class({
      extends: cc.Component,
      properties: {
        text: {
          default: "",
          notify: function notify() {
            this._updateContent();
          }
        }
      },
      start: function start() {
        var _this = this;
        this.node.on(cc.Node.EventType.TOUCH_START, function() {
          _this.node._touchListener.setSwallowTouches(false);
          if (_this.node.active) {
            _this.node.active = false;
            _this.node.emit("click");
            return;
          }
        });
      },
      _updateContent: function _updateContent() {
        this.node.active = true;
        this.label || (this.label = this.node.getComponentInChildren(cc.Label));
        this.label.string = this.text;
      }
    });
    cc._RF.pop();
  }, {} ],
  Hud: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "0d6788hXBNMtZwbzQJ4DntH", "Hud");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var GameMng_1 = require("./GameMng");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var Hud = function(_super) {
      __extends(Hud, _super);
      function Hud() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.tutAnimVert = function(G) {
          G.tutAnimFlip = !G.tutAnimFlip;
          if (G.tutAnimFlip) {
            this.tutHandX = 325;
            this.tutHandY = 300;
            G.tutTween = TweenMax.to(G, .5, {
              tutHandY: 500,
              ease: "Cubic.easeOut",
              delay: .5,
              onComplete: G.tutAnimVert,
              onCompleteParams: [ G ]
            });
          } else {
            this.tutHandX = 325;
            this.tutHandY = 500;
            G.tutTween = TweenMax.to(G, .5, {
              tutHandY: 300,
              ease: "Cubic.easeOut",
              delay: .5,
              onComplete: G.tutAnimVert,
              onCompleteParams: [ G ]
            });
          }
        };
        _this.collectGem = function() {
          this.chainBarFlipCount = 1;
        };
        _this.render = function(G) {};
        return _this;
      }
      Hud.prototype.onLoad = function() {
        GameMng_1.default.hud = this;
        this.init();
      };
      Hud.prototype.init = function() {
        this.bigNumberSpace = 19;
        this.smallNumberSpace = 13;
        this.barPerc = .1;
        this.chainBarFlipCount = 0;
        this.flareRot = 0;
        this.flareY = 0;
        this.tutState = 0;
        this.tutCount = 0;
        this.tutAnimFlip = true;
        GameMng_1.default.firstRun && this.tutAnimHoriz(this);
      };
      Hud.prototype.tutAnimHoriz = function(G) {
        G.tutAnimFlip = !G.tutAnimFlip;
        if (G.tutAnimFlip) {
          this.tutHandX = 50;
          this.tutHandY = 320;
          G.tutTween = TweenMax.to(G, .5, {
            tutHandX: GameMng_1.default.canvas.width - 100,
            ease: "Cubic.easeOut",
            delay: .5,
            onComplete: G.tutAnimHoriz,
            onCompleteParams: [ G ]
          });
        } else {
          this.tutHandX = GameMng_1.default.canvas.width - 100;
          this.tutHandY = 320;
          G.tutTween = TweenMax.to(G, .5, {
            tutHandX: 100,
            ease: "Cubic.easeOut",
            delay: .5,
            onComplete: G.tutAnimHoriz,
            onCompleteParams: [ G ]
          });
        }
      };
      Hud = __decorate([ ccclass ], Hud);
      return Hud;
    }(cc.Component);
    exports.Hud = Hud;
    cc._RF.pop();
  }, {
    "./GameMng": "GameMng"
  } ],
  IDataModel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2995bNc/4FHupIpPoRTrZB9", "IDataModel");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var EventMng_1 = require("../manager/EventMng");
    var NetMng_1 = require("../manager/NetMng");
    var DataUtil_1 = require("../main/utils/DataUtil");
    var IDataModel = function(_super) {
      __extends(IDataModel, _super);
      function IDataModel(modelName) {
        void 0 === modelName && (modelName = "default");
        var _this = _super.call(this) || this;
        _this.modelName = "default";
        _this.syncLocalDataInterval = 10;
        _this.lastLocalData = "";
        _this.intervalId = null;
        _this.isStartInterval = true;
        _this._notifyEventList = new Map();
        _this._dLocalData = {};
        _this.modelName = modelName;
        _this.LoadStorage();
        _this.registerListeners();
        _this.isStartInterval && _this._syncLocalDataInterval();
        return _this;
      }
      IDataModel.prototype.clear = function() {
        this.clearListeners();
        this._destruct();
      };
      IDataModel.prototype.registerListeners = function() {
        var _this = this;
        var tbMsg = this.getMessageListeners();
        tbMsg[cc.game.EVENT_HIDE] = function(event) {
          _this.Save();
        };
        var _loop_1 = function(key) {
          if (tbMsg.hasOwnProperty(key)) {
            var func = function(msg) {
              tbMsg[key](msg);
            };
            EventMng_1.default.on(key.toString(), func);
            this_1._notifyEventList.set(key.toString(), func);
          }
        };
        var this_1 = this;
        for (var key in tbMsg) _loop_1(key);
      };
      IDataModel.prototype.clearListeners = function() {
        var self = void 0;
        this._notifyEventList.forEach(function(f, key) {
          EventMng_1.default.off(key, f, self);
        }, this);
        this._notifyEventList.clear();
        this.unscheduleAllCallbacks();
      };
      IDataModel.prototype.getMessageListeners = function() {
        return {};
      };
      IDataModel.prototype.sendProtocolMsg = function(msg) {
        try {
          NetMng_1.default.send(msg);
        } catch (e) {
          console.error("send proto", msg, e);
        }
      };
      IDataModel.prototype.LoadStorage = function() {
        try {
          this.lastLocalData = cc.sys.localStorage.getItem("model_" + this.modelName);
          var data = JSON.parse(this.lastLocalData);
          if (data && "" !== data) this._dLocalData = data; else {
            this._dLocalData = {};
            this.Save();
          }
        } catch (e) {
          this._dLocalData = {};
          this.lastLocalData = "";
          this.Save();
        }
      };
      IDataModel.prototype.Query = function(sKey, defaultValue) {
        void 0 === defaultValue && (defaultValue = null);
        if (void 0 != this._dLocalData[sKey]) return this._dLocalData[sKey];
        return defaultValue;
      };
      IDataModel.prototype.Set = function(sKey, value) {
        if (this._dLocalData[sKey] && this._dLocalData[sKey] == value) return false;
        this._dLocalData[sKey] = value;
        return true;
      };
      IDataModel.prototype.Save = function() {
        var dataNow = JSON.stringify(this._dLocalData);
        if (dataNow != this.lastLocalData) {
          this.lastLocalData = dataNow;
          cc.sys.localStorage.setItem("model_" + this.modelName, dataNow);
          this.onSave();
        }
        this._syncLocalDataInterval();
      };
      IDataModel.prototype.onSave = function() {};
      IDataModel.prototype._syncLocalDataInterval = function() {
        var _this = this;
        var func = function() {
          _this.Save();
        };
        this.unschedule(func);
        this.scheduleOnce(func, this.syncLocalDataInterval);
      };
      IDataModel.prototype.InitData = function(data) {
        DataUtil_1.default.dataAssignCopy(data, this._dLocalData);
        this._dLocalData = data;
      };
      IDataModel.prototype.getAllData = function() {
        return this._dLocalData;
      };
      IDataModel.prototype.getModelName = function() {
        return this.modelName;
      };
      return IDataModel;
    }(cc.Component);
    exports.default = IDataModel;
    cc._RF.pop();
  }, {
    "../main/utils/DataUtil": "DataUtil",
    "../manager/EventMng": "EventMng",
    "../manager/NetMng": "NetMng"
  } ],
  JsonOb: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "000b00Lx19Ke4hAFc9/Qlnh", "JsonOb");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var OP = Object.prototype;
    var types = {
      obj: "[object Object]",
      array: "[object Array]"
    };
    var OAM = [ "push", "pop", "shift", "unshift", "sort", "reverse", "splice" ];
    var JsonOb = function() {
      function JsonOb(obj, callback) {
        OP.toString.call(obj) !== types.obj && OP.toString.call(obj) !== types.array && console.error("\u8bf7\u4f20\u5165\u4e00\u4e2a\u5bf9\u8c61\u6216\u6570\u7ec4");
        this._callback = callback;
        this.observe(obj);
      }
      JsonOb.prototype.observe = function(obj, path) {
        var _this = this;
        OP.toString.call(obj) === types.array && this.overrideArrayProto(obj, path);
        Object.keys(obj).forEach(function(key) {
          var self = _this;
          var oldVal = obj[key];
          var pathArray = path && path.slice();
          pathArray ? pathArray.push(key) : pathArray = [ key ];
          Object.defineProperty(obj, key, {
            get: function() {
              return oldVal;
            },
            set: function(newVal) {
              if (oldVal !== newVal) {
                "[object Object]" === OP.toString.call(newVal) && self.observe(newVal, pathArray);
                var oldValCopy = oldVal;
                oldVal = newVal;
                self._callback(newVal, oldValCopy, pathArray);
              }
            }
          });
          OP.toString.call(obj[key]) !== types.obj && OP.toString.call(obj[key]) !== types.array || _this.observe(obj[key], pathArray);
        }, this);
      };
      JsonOb.prototype.overrideArrayProto = function(array, path) {
        var originalProto = Array.prototype;
        var overrideProto = Object.create(Array.prototype);
        var self = this;
        var result;
        OAM.forEach(function(method) {
          Object.defineProperty(overrideProto, method, {
            value: function() {
              var oldVal = this.slice();
              result = originalProto[method].apply(this, arguments);
              self.observe(this, path);
              self._callback(this, oldVal, path);
              return result;
            }
          });
        });
        array["__proto__"] = overrideProto;
      };
      return JsonOb;
    }();
    exports.JsonOb = JsonOb;
    cc._RF.pop();
  }, {} ],
  ListItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "acbb3ux6UFJuaUOYSqrldtn", "ListItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, disallowMultiple = _a.disallowMultiple, menu = _a.menu, executionOrder = _a.executionOrder;
    var SelectedType;
    (function(SelectedType) {
      SelectedType[SelectedType["NONE"] = 0] = "NONE";
      SelectedType[SelectedType["TOGGLE"] = 1] = "TOGGLE";
      SelectedType[SelectedType["SWITCH"] = 2] = "SWITCH";
    })(SelectedType || (SelectedType = {}));
    var ListItem = function(_super) {
      __extends(ListItem, _super);
      function ListItem() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.icon = null;
        _this.title = null;
        _this.selectedMode = SelectedType.NONE;
        _this.selectedFlag = null;
        _this.selectedSpriteFrame = null;
        _this._unselectedSpriteFrame = null;
        _this.adaptiveSize = false;
        _this._selected = false;
        _this._eventReg = false;
        return _this;
      }
      Object.defineProperty(ListItem.prototype, "selected", {
        get: function() {
          return this._selected;
        },
        set: function(val) {
          this._selected = val;
          if (!this.selectedFlag) return;
          switch (this.selectedMode) {
           case SelectedType.TOGGLE:
            this.selectedFlag.active = val;
            break;

           case SelectedType.SWITCH:
            var sp = this.selectedFlag.getComponent(cc.Sprite);
            sp && (sp.spriteFrame = val ? this.selectedSpriteFrame : this._unselectedSpriteFrame);
          }
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(ListItem.prototype, "btnCom", {
        get: function() {
          this._btnCom || (this._btnCom = this.node.getComponent(cc.Button));
          return this._btnCom;
        },
        enumerable: true,
        configurable: true
      });
      ListItem.prototype.onLoad = function() {
        this.btnCom || this.selectedMode == SelectedType.NONE;
        if (this.selectedMode == SelectedType.SWITCH) {
          var com = this.selectedFlag.getComponent(cc.Sprite);
          this._unselectedSpriteFrame = com.spriteFrame;
        }
      };
      ListItem.prototype.onDestroy = function() {
        var t = this;
        t.node.off(cc.Node.EventType.SIZE_CHANGED, t._onSizeChange, t);
      };
      ListItem.prototype._registerEvent = function() {
        var t = this;
        if (!t._eventReg) {
          t.btnCom && t.list.selectedMode > 0 && t.btnCom.clickEvents.unshift(t.createEvt(t, "onClickThis"));
          t.adaptiveSize && t.node.on(cc.Node.EventType.SIZE_CHANGED, t._onSizeChange, t);
          t._eventReg = true;
        }
      };
      ListItem.prototype._onSizeChange = function() {
        this.list._onItemAdaptive(this.node);
      };
      ListItem.prototype.createEvt = function(component, handlerName, node) {
        void 0 === node && (node = null);
        if (!component.isValid) return;
        component["comName"] = component["comName"] || component.name.match(/\<(.*?)\>/g).pop().replace(/\<|>/g, "");
        var evt = new cc.Component.EventHandler();
        evt.target = node || component.node;
        evt.component = component["comName"];
        evt.handler = handlerName;
        return evt;
      };
      ListItem.prototype.showAni = function(aniType, callFunc, del) {
        var _this = this;
        var acts;
        switch (aniType) {
         case 0:
          acts = [ cc.scaleTo(.2, .7), cc.moveBy(.3, 0, 2 * this.node.height) ];
          break;

         case 1:
          acts = [ cc.scaleTo(.2, .7), cc.moveBy(.3, 2 * this.node.width, 0) ];
          break;

         case 2:
          acts = [ cc.scaleTo(.2, .7), cc.moveBy(.3, 0, -2 * this.node.height) ];
          break;

         case 3:
          acts = [ cc.scaleTo(.2, .7), cc.moveBy(.3, -2 * this.node.width, 0) ];
          break;

         default:
          acts = [ cc.scaleTo(.3, .1) ];
        }
        (callFunc || del) && acts.push(cc.callFunc(function() {
          if (del) {
            _this.list._delSingleItem(_this.node);
            for (var n = _this.list.displayData.length - 1; n >= 0; n--) if (_this.list.displayData[n].id == _this.listId) {
              _this.list.displayData.splice(n, 1);
              break;
            }
          }
          callFunc && callFunc();
        }));
        this.node.runAction(cc.sequence(acts));
      };
      ListItem.prototype.onClickThis = function() {
        this.list.selectedId = this.listId;
      };
      __decorate([ property({
        type: cc.Sprite,
        tooltip: false
      }) ], ListItem.prototype, "icon", void 0);
      __decorate([ property({
        type: cc.Node,
        tooltip: false
      }) ], ListItem.prototype, "title", void 0);
      __decorate([ property({
        type: cc.Enum(SelectedType),
        tooltip: false
      }) ], ListItem.prototype, "selectedMode", void 0);
      __decorate([ property({
        type: cc.Node,
        tooltip: false,
        visible: function() {
          return this.selectedMode > SelectedType.NONE;
        }
      }) ], ListItem.prototype, "selectedFlag", void 0);
      __decorate([ property({
        type: cc.SpriteFrame,
        tooltip: false,
        visible: function() {
          return this.selectedMode == SelectedType.SWITCH;
        }
      }) ], ListItem.prototype, "selectedSpriteFrame", void 0);
      __decorate([ property({
        tooltip: false
      }) ], ListItem.prototype, "adaptiveSize", void 0);
      ListItem = __decorate([ ccclass, disallowMultiple(), menu("\u81ea\u5b9a\u4e49\u7ec4\u4ef6/List Item"), executionOrder(-5001) ], ListItem);
      return ListItem;
    }(cc.Component);
    exports.default = ListItem;
    cc._RF.pop();
  }, {} ],
  List: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "10a50/1+71EJ7r78iA183eX", "List");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, disallowMultiple = _a.disallowMultiple, menu = _a.menu, executionOrder = _a.executionOrder, requireComponent = _a.requireComponent;
    var ListItem_1 = require("./ListItem");
    var TemplateType;
    (function(TemplateType) {
      TemplateType[TemplateType["NODE"] = 1] = "NODE";
      TemplateType[TemplateType["PREFAB"] = 2] = "PREFAB";
    })(TemplateType || (TemplateType = {}));
    var SlideType;
    (function(SlideType) {
      SlideType[SlideType["NORMAL"] = 1] = "NORMAL";
      SlideType[SlideType["ADHERING"] = 2] = "ADHERING";
      SlideType[SlideType["PAGE"] = 3] = "PAGE";
    })(SlideType || (SlideType = {}));
    var SelectedType;
    (function(SelectedType) {
      SelectedType[SelectedType["NONE"] = 0] = "NONE";
      SelectedType[SelectedType["SINGLE"] = 1] = "SINGLE";
      SelectedType[SelectedType["MULT"] = 2] = "MULT";
    })(SelectedType || (SelectedType = {}));
    var List = function(_super) {
      __extends(List, _super);
      function List() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.templateType = TemplateType.NODE;
        _this.tmpNode = null;
        _this.tmpPrefab = null;
        _this._slideMode = SlideType.NORMAL;
        _this.pageViewIndicator = null;
        _this.pageDistance = .3;
        _this.pageChangeEvent = new cc.Component.EventHandler();
        _this._virtual = true;
        _this.cyclic = false;
        _this.lackCenter = false;
        _this.lackSlide = false;
        _this._updateRate = 0;
        _this.frameByFrameRenderNum = 0;
        _this.renderEvent = new cc.Component.EventHandler();
        _this.selectedMode = SelectedType.NONE;
        _this.repeatEventSingle = false;
        _this.selectedEvent = null;
        _this._selectedId = -1;
        _this._forceUpdate = false;
        _this._updateDone = true;
        _this._numItems = 0;
        _this._inited = false;
        _this._needUpdateWidget = false;
        _this._aniDelRuning = false;
        _this._doneAfterUpdate = false;
        _this.adhering = false;
        _this._adheringBarrier = false;
        _this._curPageNum = 0;
        _this._curPageIdx = 0;
        return _this;
      }
      Object.defineProperty(List.prototype, "slideMode", {
        get: function() {
          return this._slideMode;
        },
        set: function(val) {
          this._slideMode = val;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "virtual", {
        get: function() {
          return this._virtual;
        },
        set: function(val) {
          null != val && (this._virtual = val);
          (true, 0 != this._numItems) && this._onScrolling();
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "updateRate", {
        get: function() {
          return this._updateRate;
        },
        set: function(val) {
          val >= 0 && val <= 6 && (this._updateRate = val);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "selectedId", {
        get: function() {
          return this._selectedId;
        },
        set: function(val) {
          var t = this;
          var item;
          switch (t.selectedMode) {
           case SelectedType.SINGLE:
            if (!t.repeatEventSingle && val == t._selectedId) return;
            item = t.getItemByListId(val);
            var listItem = void 0;
            t._selectedId >= 0 ? t._lastSelectedId = t._selectedId : t._lastSelectedId = null;
            t._selectedId = val;
            if (item) {
              listItem = item.getComponent(ListItem_1.default);
              listItem.selected = true;
            }
            if (t._lastSelectedId >= 0 && t._lastSelectedId != t._selectedId) {
              var lastItem = t.getItemByListId(t._lastSelectedId);
              lastItem && (lastItem.getComponent(ListItem_1.default).selected = false);
            }
            t.selectedEvent && cc.Component.EventHandler.emitEvents([ t.selectedEvent ], item, null == t._lastSelectedId ? null : t._lastSelectedId % this._actualNumItems);
            break;

           case SelectedType.MULT:
            item = t.getItemByListId(val);
            if (!item) return;
            var listItem = item.getComponent(ListItem_1.default);
            t._selectedId >= 0 && (t._lastSelectedId = t._selectedId);
            t._selectedId = val;
            var bool = !listItem.selected;
            listItem.selected = bool;
            var sub = t.multSelected.indexOf(val);
            bool && sub < 0 ? t.multSelected.push(val) : !bool && sub >= 0 && t.multSelected.splice(sub, 1);
            t.selectedEvent && cc.Component.EventHandler.emitEvents([ t.selectedEvent ], item, null == t._lastSelectedId ? null : t._lastSelectedId % this._actualNumItems, bool);
          }
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "numItems", {
        get: function() {
          return this._actualNumItems;
        },
        set: function(val) {
          var t = this;
          if (!t.checkInited(false)) return;
          if (null == val || val < 0) {
            cc.error("numItems set the wrong::", val);
            return;
          }
          t._actualNumItems = t._numItems = val;
          t._forceUpdate = true;
          if (t._virtual) {
            t._resizeContent();
            t.cyclic && (t._numItems = t._cyclicNum * t._numItems);
            t._onScrolling();
            t.frameByFrameRenderNum || t.slideMode != SlideType.PAGE || (t.curPageNum = t.nearestListId);
          } else {
            var layout = t.content.getComponent(cc.Layout);
            layout && (layout.enabled = true);
            t._delRedundantItem();
            t.firstListId = 0;
            if (t.frameByFrameRenderNum > 0) {
              var len = t.frameByFrameRenderNum > t._numItems ? t._numItems : t.frameByFrameRenderNum;
              for (var n = 0; n < len; n++) t._createOrUpdateItem2(n);
              if (t.frameByFrameRenderNum < t._numItems) {
                t._updateCounter = t.frameByFrameRenderNum;
                t._updateDone = false;
              }
            } else {
              for (var n = 0; n < val; n++) t._createOrUpdateItem2(n);
              t.displayItemNum = val;
            }
          }
          t.pageViewIndicator && t.pageViewIndicator.setPageView(t);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "scrollView", {
        get: function() {
          return this._scrollView;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "curPageNum", {
        get: function() {
          return this._curPageNum;
        },
        set: function(val) {
          var t = this;
          if (null == val || val < 0) {
            cc.error("curPageNum set the wrong::", val);
            return;
          }
          t.curPageIdx = val;
          t._curPageNum = val;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(List.prototype, "curPageIdx", {
        get: function() {
          return this._curPageIdx;
        },
        set: function(val) {
          var t = this;
          if (null == val || val < 0) {
            cc.error("curPageIdx set the wrong::", val);
            return;
          }
          t._curPageIdx = val;
          t.pageViewIndicator && t.pageViewIndicator._changedState();
        },
        enumerable: true,
        configurable: true
      });
      List.prototype.onLoad = function() {
        this._init();
      };
      List.prototype.onDestroy = function() {
        this._itemTmp && this._itemTmp.isValid && this._itemTmp.destroy();
        while (this._pool.size()) {
          var node = this._pool.get();
          node.destroy();
        }
      };
      List.prototype.onEnable = function() {
        this._registerEvent();
        this._init();
      };
      List.prototype.onDisable = function() {
        this._unregisterEvent();
      };
      List.prototype._registerEvent = function() {
        var t = this;
        t.node.on(cc.Node.EventType.TOUCH_START, t._onTouchStart, t, true);
        t.node.on("touch-up", t._onTouchUp, t);
        t.node.on(cc.Node.EventType.TOUCH_CANCEL, t._onTouchCancelled, t, true);
        t.node.on("scroll-began", t._onScrollBegan, t, true);
        t.node.on("scroll-ended", t._onScrollEnded, t, true);
        t.node.on("scrolling", t._onScrolling, t, true);
        t.node.on(cc.Node.EventType.SIZE_CHANGED, t._onSizeChanged, t);
      };
      List.prototype._unregisterEvent = function() {
        var t = this;
        t.node.off(cc.Node.EventType.TOUCH_START, t._onTouchStart, t, true);
        t.node.off("touch-up", t._onTouchUp, t);
        t.node.off(cc.Node.EventType.TOUCH_CANCEL, t._onTouchCancelled, t, true);
        t.node.off("scroll-began", t._onScrollBegan, t, true);
        t.node.off("scroll-ended", t._onScrollEnded, t, true);
        t.node.off("scrolling", t._onScrolling, t, true);
        t.node.off(cc.Node.EventType.SIZE_CHANGED, t._onSizeChanged, t);
      };
      List.prototype._init = function() {
        var t = this;
        if (t._inited) return;
        t._scrollView = t.node.getComponent(cc.ScrollView);
        t.content = t._scrollView.content;
        if (!t.content) {
          cc.error(t.node.name + "'s cc.ScrollView unset content!");
          return;
        }
        t._layout = t.content.getComponent(cc.Layout);
        t._align = t._layout.type;
        t._resizeMode = t._layout.resizeMode;
        t._startAxis = t._layout.startAxis;
        t._topGap = t._layout.paddingTop;
        t._rightGap = t._layout.paddingRight;
        t._bottomGap = t._layout.paddingBottom;
        t._leftGap = t._layout.paddingLeft;
        t._columnGap = t._layout.spacingX;
        t._lineGap = t._layout.spacingY;
        t._colLineNum;
        t._verticalDir = t._layout.verticalDirection;
        t._horizontalDir = t._layout.horizontalDirection;
        t.setTemplateItem(cc.instantiate(t.templateType == TemplateType.PREFAB ? t.tmpPrefab : t.tmpNode));
        if (t._slideMode == SlideType.ADHERING || t._slideMode == SlideType.PAGE) {
          t._scrollView.inertia = false;
          t._scrollView._onMouseWheel = function() {
            return;
          };
        }
        t.virtual || (t.lackCenter = false);
        t._lastDisplayData = [];
        t.displayData = [];
        t._pool = new cc.NodePool();
        t._forceUpdate = false;
        t._updateCounter = 0;
        t._updateDone = true;
        t.curPageNum = 0;
        if (t.cyclic || 0) {
          t._scrollView._processAutoScrolling = this._processAutoScrolling.bind(t);
          t._scrollView._startBounceBackIfNeeded = function() {
            return false;
          };
        }
        switch (t._align) {
         case cc.Layout.Type.HORIZONTAL:
          switch (t._horizontalDir) {
           case cc.Layout.HorizontalDirection.LEFT_TO_RIGHT:
            t._alignCalcType = 1;
            break;

           case cc.Layout.HorizontalDirection.RIGHT_TO_LEFT:
            t._alignCalcType = 2;
          }
          break;

         case cc.Layout.Type.VERTICAL:
          switch (t._verticalDir) {
           case cc.Layout.VerticalDirection.TOP_TO_BOTTOM:
            t._alignCalcType = 3;
            break;

           case cc.Layout.VerticalDirection.BOTTOM_TO_TOP:
            t._alignCalcType = 4;
          }
          break;

         case cc.Layout.Type.GRID:
          switch (t._startAxis) {
           case cc.Layout.AxisDirection.HORIZONTAL:
            switch (t._verticalDir) {
             case cc.Layout.VerticalDirection.TOP_TO_BOTTOM:
              t._alignCalcType = 3;
              break;

             case cc.Layout.VerticalDirection.BOTTOM_TO_TOP:
              t._alignCalcType = 4;
            }
            break;

           case cc.Layout.AxisDirection.VERTICAL:
            switch (t._horizontalDir) {
             case cc.Layout.HorizontalDirection.LEFT_TO_RIGHT:
              t._alignCalcType = 1;
              break;

             case cc.Layout.HorizontalDirection.RIGHT_TO_LEFT:
              t._alignCalcType = 2;
            }
          }
        }
        t.content.children.forEach(function(child) {
          child.removeFromParent();
          child != t.tmpNode && child.isValid && child.destroy();
        });
        t._inited = true;
      };
      List.prototype._processAutoScrolling = function(dt) {
        var brakingFactor = 1;
        this._scrollView["_autoScrollAccumulatedTime"] += dt * (1 / brakingFactor);
        var percentage = Math.min(1, this._scrollView["_autoScrollAccumulatedTime"] / this._scrollView["_autoScrollTotalTime"]);
        if (this._scrollView["_autoScrollAttenuate"]) {
          var time = percentage - 1;
          percentage = time * time * time * time * time + 1;
        }
        var newPosition = this._scrollView["_autoScrollStartPosition"].add(this._scrollView["_autoScrollTargetDelta"].mul(percentage));
        var EPSILON = this._scrollView["getScrollEndedEventTiming"]();
        var reachedEnd = Math.abs(percentage - 1) <= EPSILON;
        var fireEvent = Math.abs(percentage - 1) <= this._scrollView["getScrollEndedEventTiming"]();
        if (fireEvent && !this._scrollView["_isScrollEndedWithThresholdEventFired"]) {
          this._scrollView["_dispatchEvent"]("scroll-ended-with-threshold");
          this._scrollView["_isScrollEndedWithThresholdEventFired"] = true;
        }
        reachedEnd && (this._scrollView["_autoScrolling"] = false);
        var deltaMove = newPosition.sub(this._scrollView.getContentPosition());
        this._scrollView["_moveContent"](this._scrollView["_clampDelta"](deltaMove), reachedEnd);
        this._scrollView["_dispatchEvent"]("scrolling");
        if (!this._scrollView["_autoScrolling"]) {
          this._scrollView["_isBouncing"] = false;
          this._scrollView["_scrolling"] = false;
          this._scrollView["_dispatchEvent"]("scroll-ended");
        }
      };
      List.prototype.setTemplateItem = function(item) {
        if (!item) return;
        var t = this;
        t._itemTmp = item;
        t._resizeMode == cc.Layout.ResizeMode.CHILDREN ? t._itemSize = t._layout.cellSize : t._itemSize = cc.size(item.width, item.height);
        var com = item.getComponent(ListItem_1.default);
        var remove = false;
        com || (remove = true);
        com && (com._btnCom || item.getComponent(cc.Button) || (remove = true));
        remove && (t.selectedMode = SelectedType.NONE);
        com = item.getComponent(cc.Widget);
        com && com.enabled && (t._needUpdateWidget = true);
        t.selectedMode == SelectedType.MULT && (t.multSelected = []);
        switch (t._align) {
         case cc.Layout.Type.HORIZONTAL:
          t._colLineNum = 1;
          t._sizeType = false;
          break;

         case cc.Layout.Type.VERTICAL:
          t._colLineNum = 1;
          t._sizeType = true;
          break;

         case cc.Layout.Type.GRID:
          switch (t._startAxis) {
           case cc.Layout.AxisDirection.HORIZONTAL:
            var trimW = t.content.width - t._leftGap - t._rightGap;
            t._colLineNum = Math.floor((trimW + t._columnGap) / (t._itemSize.width + t._columnGap));
            t._sizeType = true;
            break;

           case cc.Layout.AxisDirection.VERTICAL:
            var trimH = t.content.height - t._topGap - t._bottomGap;
            t._colLineNum = Math.floor((trimH + t._lineGap) / (t._itemSize.height + t._lineGap));
            t._sizeType = false;
          }
        }
      };
      List.prototype.checkInited = function(printLog) {
        void 0 === printLog && (printLog = true);
        if (!this._inited) {
          printLog && cc.error("List initialization not completed!");
          return false;
        }
        return true;
      };
      List.prototype._resizeContent = function() {
        var t = this;
        var result;
        switch (t._align) {
         case cc.Layout.Type.HORIZONTAL:
          if (t._customSize) {
            var fixed = t._getFixedSize(null);
            result = t._leftGap + fixed.val + t._itemSize.width * (t._numItems - fixed.count) + t._columnGap * (t._numItems - 1) + t._rightGap;
          } else result = t._leftGap + t._itemSize.width * t._numItems + t._columnGap * (t._numItems - 1) + t._rightGap;
          break;

         case cc.Layout.Type.VERTICAL:
          if (t._customSize) {
            var fixed = t._getFixedSize(null);
            result = t._topGap + fixed.val + t._itemSize.height * (t._numItems - fixed.count) + t._lineGap * (t._numItems - 1) + t._bottomGap;
          } else result = t._topGap + t._itemSize.height * t._numItems + t._lineGap * (t._numItems - 1) + t._bottomGap;
          break;

         case cc.Layout.Type.GRID:
          t.lackCenter && (t.lackCenter = false);
          switch (t._startAxis) {
           case cc.Layout.AxisDirection.HORIZONTAL:
            var lineNum = Math.ceil(t._numItems / t._colLineNum);
            result = t._topGap + t._itemSize.height * lineNum + t._lineGap * (lineNum - 1) + t._bottomGap;
            break;

           case cc.Layout.AxisDirection.VERTICAL:
            var colNum = Math.ceil(t._numItems / t._colLineNum);
            result = t._leftGap + t._itemSize.width * colNum + t._columnGap * (colNum - 1) + t._rightGap;
          }
        }
        var layout = t.content.getComponent(cc.Layout);
        layout && (layout.enabled = false);
        t._allItemSize = result;
        t._allItemSizeNoEdge = t._allItemSize - (t._sizeType ? t._topGap + t._bottomGap : t._leftGap + t._rightGap);
        if (t.cyclic) {
          var totalSize = t._sizeType ? t.node.height : t.node.width;
          t._cyclicPos1 = 0;
          totalSize -= t._cyclicPos1;
          t._cyclicNum = Math.ceil(totalSize / t._allItemSizeNoEdge) + 1;
          var spacing = t._sizeType ? t._lineGap : t._columnGap;
          t._cyclicPos2 = t._cyclicPos1 + t._allItemSizeNoEdge + spacing;
          t._cyclicAllItemSize = t._allItemSize + t._allItemSizeNoEdge * (t._cyclicNum - 1) + spacing * (t._cyclicNum - 1);
          t._cycilcAllItemSizeNoEdge = t._allItemSizeNoEdge * t._cyclicNum;
          t._cycilcAllItemSizeNoEdge += spacing * (t._cyclicNum - 1);
        }
        t._lack = !t.cyclic && t._allItemSize < (t._sizeType ? t.node.height : t.node.width);
        var slideOffset = t._lack && t.lackCenter || !t.lackSlide ? .1 : 0;
        var targetWH = t._lack ? (t._sizeType ? t.node.height : t.node.width) - slideOffset : t.cyclic ? t._cyclicAllItemSize : t._allItemSize;
        targetWH < 0 && (targetWH = 0);
        t._sizeType ? t.content.height = targetWH : t.content.width = targetWH;
      };
      List.prototype._onScrolling = function(ev) {
        void 0 === ev && (ev = null);
        null == this.frameCount && (this.frameCount = this._updateRate);
        if (!this._forceUpdate && ev && "scroll-ended" != ev.type && this.frameCount > 0) {
          this.frameCount--;
          return;
        }
        this.frameCount = this._updateRate;
        if (this._aniDelRuning) return;
        if (this.cyclic) {
          var scrollPos = this.content.getPosition();
          scrollPos = this._sizeType ? scrollPos.y : scrollPos.x;
          var addVal = this._allItemSizeNoEdge + (this._sizeType ? this._lineGap : this._columnGap);
          var add = this._sizeType ? cc.v2(0, addVal) : cc.v2(addVal, 0);
          switch (this._alignCalcType) {
           case 1:
            if (scrollPos > -this._cyclicPos1) {
              this.content.x = -this._cyclicPos2;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].sub(add));
            } else if (scrollPos < -this._cyclicPos2) {
              this.content.x = -this._cyclicPos1;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].add(add));
            }
            break;

           case 2:
            if (scrollPos < this._cyclicPos1) {
              this.content.x = this._cyclicPos2;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].add(add));
            } else if (scrollPos > this._cyclicPos2) {
              this.content.x = this._cyclicPos1;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].sub(add));
            }
            break;

           case 3:
            if (scrollPos < this._cyclicPos1) {
              this.content.y = this._cyclicPos2;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].add(add));
            } else if (scrollPos > this._cyclicPos2) {
              this.content.y = this._cyclicPos1;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].sub(add));
            }
            break;

           case 4:
            if (scrollPos > -this._cyclicPos1) {
              this.content.y = -this._cyclicPos2;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].sub(add));
            } else if (scrollPos < -this._cyclicPos2) {
              this.content.y = -this._cyclicPos1;
              this._scrollView.isAutoScrolling() && (this._scrollView["_autoScrollStartPosition"] = this._scrollView["_autoScrollStartPosition"].add(add));
            }
          }
        }
        this._calcViewPos();
        var vTop, vRight, vBottom, vLeft;
        if (this._sizeType) {
          vTop = this.viewTop;
          vBottom = this.viewBottom;
        } else {
          vRight = this.viewRight;
          vLeft = this.viewLeft;
        }
        if (this._virtual) {
          this.displayData = [];
          var itemPos = void 0;
          var curId = 0;
          var endId = this._numItems - 1;
          if (this._customSize) {
            var breakFor = false;
            for (;curId <= endId && !breakFor; curId++) {
              itemPos = this._calcItemPos(curId);
              switch (this._align) {
               case cc.Layout.Type.HORIZONTAL:
                itemPos.right >= vLeft && itemPos.left <= vRight ? this.displayData.push(itemPos) : 0 != curId && this.displayData.length > 0 && (breakFor = true);
                break;

               case cc.Layout.Type.VERTICAL:
                itemPos.bottom <= vTop && itemPos.top >= vBottom ? this.displayData.push(itemPos) : 0 != curId && this.displayData.length > 0 && (breakFor = true);
                break;

               case cc.Layout.Type.GRID:
                switch (this._startAxis) {
                 case cc.Layout.AxisDirection.HORIZONTAL:
                  itemPos.bottom <= vTop && itemPos.top >= vBottom ? this.displayData.push(itemPos) : 0 != curId && this.displayData.length > 0 && (breakFor = true);
                  break;

                 case cc.Layout.AxisDirection.VERTICAL:
                  itemPos.right >= vLeft && itemPos.left <= vRight ? this.displayData.push(itemPos) : 0 != curId && this.displayData.length > 0 && (breakFor = true);
                }
              }
            }
          } else {
            var ww = this._itemSize.width + this._columnGap;
            var hh = this._itemSize.height + this._lineGap;
            switch (this._alignCalcType) {
             case 1:
              curId = (vLeft + this._leftGap) / ww;
              endId = (vRight + this._rightGap) / ww;
              break;

             case 2:
              curId = (-vRight - this._rightGap) / ww;
              endId = (-vLeft - this._leftGap) / ww;
              break;

             case 3:
              curId = (-vTop - this._topGap) / hh;
              endId = (-vBottom - this._bottomGap) / hh;
              break;

             case 4:
              curId = (vBottom + this._bottomGap) / hh;
              endId = (vTop + this._topGap) / hh;
            }
            curId = Math.floor(curId) * this._colLineNum;
            endId = Math.ceil(endId) * this._colLineNum;
            endId--;
            curId < 0 && (curId = 0);
            endId >= this._numItems && (endId = this._numItems - 1);
            for (;curId <= endId; curId++) this.displayData.push(this._calcItemPos(curId));
          }
          if (this.displayData.length <= 0 || !this._numItems) {
            this._lastDisplayData = [];
            this._delRedundantItem();
            return;
          }
          this.firstListId = this.displayData[0].id;
          this.displayItemNum = this.displayData.length;
          var len = this._lastDisplayData.length;
          if (this._forceUpdate || this.displayItemNum != len || this.firstListId != this._lastDisplayData[0] || this.displayData[this.displayItemNum - 1].id != this._lastDisplayData[len - 1]) {
            this._lastDisplayData = [];
            if (this.frameByFrameRenderNum > 0) if (this._numItems > 0) {
              this._updateDone ? this._updateCounter = 0 : this._doneAfterUpdate = true;
              this._updateDone = false;
            } else {
              this._delRedundantItem();
              this._updateCounter = 0;
              this._updateDone = true;
            } else {
              for (var c = 0; c < this.displayItemNum; c++) this._createOrUpdateItem(this.displayData[c]);
              this._delRedundantItem();
              this._forceUpdate = false;
            }
          }
          this._calcNearestItem();
        }
      };
      List.prototype._calcViewPos = function() {
        var scrollPos = this.content.getPosition();
        switch (this._alignCalcType) {
         case 1:
          this.elasticLeft = scrollPos.x > 0 ? scrollPos.x : 0;
          this.viewLeft = (scrollPos.x < 0 ? -scrollPos.x : 0) - this.elasticLeft;
          this.viewRight = this.viewLeft + this.node.width;
          this.elasticRight = this.viewRight > this.content.width ? Math.abs(this.viewRight - this.content.width) : 0;
          this.viewRight += this.elasticRight;
          break;

         case 2:
          this.elasticRight = scrollPos.x < 0 ? -scrollPos.x : 0;
          this.viewRight = (scrollPos.x > 0 ? -scrollPos.x : 0) + this.elasticRight;
          this.viewLeft = this.viewRight - this.node.width;
          this.elasticLeft = this.viewLeft < -this.content.width ? Math.abs(this.viewLeft + this.content.width) : 0;
          this.viewLeft -= this.elasticLeft;
          break;

         case 3:
          this.elasticTop = scrollPos.y < 0 ? Math.abs(scrollPos.y) : 0;
          this.viewTop = (scrollPos.y > 0 ? -scrollPos.y : 0) + this.elasticTop;
          this.viewBottom = this.viewTop - this.node.height;
          this.elasticBottom = this.viewBottom < -this.content.height ? Math.abs(this.viewBottom + this.content.height) : 0;
          this.viewBottom += this.elasticBottom;
          break;

         case 4:
          this.elasticBottom = scrollPos.y > 0 ? Math.abs(scrollPos.y) : 0;
          this.viewBottom = (scrollPos.y < 0 ? -scrollPos.y : 0) - this.elasticBottom;
          this.viewTop = this.viewBottom + this.node.height;
          this.elasticTop = this.viewTop > this.content.height ? Math.abs(this.viewTop - this.content.height) : 0;
          this.viewTop -= this.elasticTop;
        }
      };
      List.prototype._calcItemPos = function(id) {
        var width, height, top, bottom, left, right, itemX, itemY;
        switch (this._align) {
         case cc.Layout.Type.HORIZONTAL:
          switch (this._horizontalDir) {
           case cc.Layout.HorizontalDirection.LEFT_TO_RIGHT:
            if (this._customSize) {
              var fixed = this._getFixedSize(id);
              left = this._leftGap + (this._itemSize.width + this._columnGap) * (id - fixed.count) + (fixed.val + this._columnGap * fixed.count);
              var cs = this._customSize[id];
              width = cs > 0 ? cs : this._itemSize.width;
            } else {
              left = this._leftGap + (this._itemSize.width + this._columnGap) * id;
              width = this._itemSize.width;
            }
            right = left + width;
            if (this.lackCenter) {
              var offset = this.content.width / 2 - this._allItemSizeNoEdge / 2;
              left += offset;
              right += offset;
            }
            return {
              id: id,
              left: left,
              right: right,
              x: left + this._itemTmp.anchorX * width,
              y: this._itemTmp.y
            };

           case cc.Layout.HorizontalDirection.RIGHT_TO_LEFT:
            if (this._customSize) {
              var fixed = this._getFixedSize(id);
              right = -this._rightGap - (this._itemSize.width + this._columnGap) * (id - fixed.count) - (fixed.val + this._columnGap * fixed.count);
              var cs = this._customSize[id];
              width = cs > 0 ? cs : this._itemSize.width;
            } else {
              right = -this._rightGap - (this._itemSize.width + this._columnGap) * id;
              width = this._itemSize.width;
            }
            left = right - width;
            if (this.lackCenter) {
              var offset = this.content.width / 2 - this._allItemSizeNoEdge / 2;
              left -= offset;
              right -= offset;
            }
            return {
              id: id,
              right: right,
              left: left,
              x: left + this._itemTmp.anchorX * width,
              y: this._itemTmp.y
            };
          }
          break;

         case cc.Layout.Type.VERTICAL:
          switch (this._verticalDir) {
           case cc.Layout.VerticalDirection.TOP_TO_BOTTOM:
            if (this._customSize) {
              var fixed = this._getFixedSize(id);
              top = -this._topGap - (this._itemSize.height + this._lineGap) * (id - fixed.count) - (fixed.val + this._lineGap * fixed.count);
              var cs = this._customSize[id];
              height = cs > 0 ? cs : this._itemSize.height;
            } else {
              top = -this._topGap - (this._itemSize.height + this._lineGap) * id;
              height = this._itemSize.height;
            }
            bottom = top - height;
            if (this.lackCenter) {
              var offset = this.content.height / 2 - this._allItemSizeNoEdge / 2;
              top -= offset;
              bottom -= offset;
            }
            return {
              id: id,
              top: top,
              bottom: bottom,
              x: this._itemTmp.x,
              y: bottom + this._itemTmp.anchorY * height
            };

           case cc.Layout.VerticalDirection.BOTTOM_TO_TOP:
            if (this._customSize) {
              var fixed = this._getFixedSize(id);
              bottom = this._bottomGap + (this._itemSize.height + this._lineGap) * (id - fixed.count) + (fixed.val + this._lineGap * fixed.count);
              var cs = this._customSize[id];
              height = cs > 0 ? cs : this._itemSize.height;
            } else {
              bottom = this._bottomGap + (this._itemSize.height + this._lineGap) * id;
              height = this._itemSize.height;
            }
            top = bottom + height;
            if (this.lackCenter) {
              var offset = this.content.height / 2 - this._allItemSizeNoEdge / 2;
              top += offset;
              bottom += offset;
            }
            return {
              id: id,
              top: top,
              bottom: bottom,
              x: this._itemTmp.x,
              y: bottom + this._itemTmp.anchorY * height
            };
          }

         case cc.Layout.Type.GRID:
          var colLine = Math.floor(id / this._colLineNum);
          switch (this._startAxis) {
           case cc.Layout.AxisDirection.HORIZONTAL:
            switch (this._verticalDir) {
             case cc.Layout.VerticalDirection.TOP_TO_BOTTOM:
              top = -this._topGap - (this._itemSize.height + this._lineGap) * colLine;
              bottom = top - this._itemSize.height;
              itemY = bottom + this._itemTmp.anchorY * this._itemSize.height;
              break;

             case cc.Layout.VerticalDirection.BOTTOM_TO_TOP:
              bottom = this._bottomGap + (this._itemSize.height + this._lineGap) * colLine;
              top = bottom + this._itemSize.height;
              itemY = bottom + this._itemTmp.anchorY * this._itemSize.height;
            }
            itemX = this._leftGap + id % this._colLineNum * (this._itemSize.width + this._columnGap);
            switch (this._horizontalDir) {
             case cc.Layout.HorizontalDirection.LEFT_TO_RIGHT:
              itemX += this._itemTmp.anchorX * this._itemSize.width;
              itemX -= this.content.anchorX * this.content.width;
              break;

             case cc.Layout.HorizontalDirection.RIGHT_TO_LEFT:
              itemX += (1 - this._itemTmp.anchorX) * this._itemSize.width;
              itemX -= (1 - this.content.anchorX) * this.content.width;
              itemX *= -1;
            }
            return {
              id: id,
              top: top,
              bottom: bottom,
              x: itemX,
              y: itemY
            };

           case cc.Layout.AxisDirection.VERTICAL:
            switch (this._horizontalDir) {
             case cc.Layout.HorizontalDirection.LEFT_TO_RIGHT:
              left = this._leftGap + (this._itemSize.width + this._columnGap) * colLine;
              right = left + this._itemSize.width;
              itemX = left + this._itemTmp.anchorX * this._itemSize.width;
              itemX -= this.content.anchorX * this.content.width;
              break;

             case cc.Layout.HorizontalDirection.RIGHT_TO_LEFT:
              right = -this._rightGap - (this._itemSize.width + this._columnGap) * colLine;
              left = right - this._itemSize.width;
              itemX = left + this._itemTmp.anchorX * this._itemSize.width;
              itemX += (1 - this.content.anchorX) * this.content.width;
            }
            itemY = -this._topGap - id % this._colLineNum * (this._itemSize.height + this._lineGap);
            switch (this._verticalDir) {
             case cc.Layout.VerticalDirection.TOP_TO_BOTTOM:
              itemY -= (1 - this._itemTmp.anchorY) * this._itemSize.height;
              itemY += (1 - this.content.anchorY) * this.content.height;
              break;

             case cc.Layout.VerticalDirection.BOTTOM_TO_TOP:
              itemY -= this._itemTmp.anchorY * this._itemSize.height;
              itemY += this.content.anchorY * this.content.height;
              itemY *= -1;
            }
            return {
              id: id,
              left: left,
              right: right,
              x: itemX,
              y: itemY
            };
          }
        }
      };
      List.prototype._calcExistItemPos = function(id) {
        var item = this.getItemByListId(id);
        if (!item) return null;
        var data = {
          id: id,
          x: item.x,
          y: item.y
        };
        if (this._sizeType) {
          data.top = item.y + item.height * (1 - item.anchorY);
          data.bottom = item.y - item.height * item.anchorY;
        } else {
          data.left = item.x - item.width * item.anchorX;
          data.right = item.x + item.width * (1 - item.anchorX);
        }
        return data;
      };
      List.prototype.getItemPos = function(id) {
        return this._virtual ? this._calcItemPos(id) : this.frameByFrameRenderNum ? this._calcItemPos(id) : this._calcExistItemPos(id);
      };
      List.prototype._getFixedSize = function(listId) {
        if (!this._customSize) return null;
        null == listId && (listId = this._numItems);
        var fixed = 0;
        var count = 0;
        for (var id in this._customSize) if (parseInt(id) < listId) {
          fixed += this._customSize[id];
          count++;
        }
        return {
          val: fixed,
          count: count
        };
      };
      List.prototype._onScrollBegan = function() {
        this._beganPos = this._sizeType ? this.viewTop : this.viewLeft;
      };
      List.prototype._onScrollEnded = function() {
        var t = this;
        if (null != t.scrollToListId) {
          var item = t.getItemByListId(t.scrollToListId);
          t.scrollToListId = null;
          item && item.runAction(cc.sequence(cc.scaleTo(.1, 1.06), cc.scaleTo(.1, 1)));
        }
        t._onScrolling();
        t._slideMode != SlideType.ADHERING || t.adhering ? t._slideMode == SlideType.PAGE && (null != t._beganPos ? this._pageAdhere() : t.adhere()) : t.adhere();
      };
      List.prototype._onTouchStart = function(ev, captureListeners) {
        if (this._scrollView["_hasNestedViewGroup"](ev, captureListeners)) return;
        var isMe = ev.eventPhase === cc.Event.AT_TARGET && ev.target === this.node;
        if (!isMe) {
          var itemNode = ev.target;
          while (null == itemNode._listId && itemNode.parent) itemNode = itemNode.parent;
          this._scrollItem = null != itemNode._listId ? itemNode : ev.target;
        }
      };
      List.prototype._onTouchUp = function() {
        var t = this;
        t._scrollPos = null;
        if (t._slideMode == SlideType.ADHERING) {
          this.adhering && (this._adheringBarrier = true);
          t.adhere();
        } else t._slideMode == SlideType.PAGE && (null != t._beganPos ? this._pageAdhere() : t.adhere());
        this._scrollItem = null;
      };
      List.prototype._onTouchCancelled = function(ev, captureListeners) {
        var t = this;
        if (t._scrollView["_hasNestedViewGroup"](ev, captureListeners) || ev.simulate) return;
        t._scrollPos = null;
        if (t._slideMode == SlideType.ADHERING) {
          t.adhering && (t._adheringBarrier = true);
          t.adhere();
        } else t._slideMode == SlideType.PAGE && (null != t._beganPos ? t._pageAdhere() : t.adhere());
        this._scrollItem = null;
      };
      List.prototype._onSizeChanged = function() {
        this.checkInited(false) && this._onScrolling();
      };
      List.prototype._onItemAdaptive = function(item) {
        var _this = this;
        if (this.checkInited(false) && (!this._sizeType && item.width != this._itemSize.width || this._sizeType && item.height != this._itemSize.height)) {
          this._customSize || (this._customSize = {});
          var val = this._sizeType ? item.height : item.width;
          if (this._customSize[item._listId] != val) {
            this._customSize[item._listId] = val;
            this._resizeContent();
            this.content.children.forEach(function(child) {
              _this._updateItemPos(child);
            });
            if (!isNaN(this._scrollToListId)) {
              this._scrollPos = null;
              this.unschedule(this._scrollToSo);
              this.scrollTo(this._scrollToListId, Math.max(0, this._scrollToEndTime - new Date().getTime() / 1e3));
            }
          }
        }
      };
      List.prototype._pageAdhere = function() {
        var t = this;
        if (!t.cyclic && (t.elasticTop > 0 || t.elasticRight > 0 || t.elasticBottom > 0 || t.elasticLeft > 0)) return;
        var curPos = t._sizeType ? t.viewTop : t.viewLeft;
        var dis = (t._sizeType ? t.node.height : t.node.width) * t.pageDistance;
        var canSkip = Math.abs(t._beganPos - curPos) > dis;
        if (canSkip) {
          var timeInSecond = .5;
          switch (t._alignCalcType) {
           case 1:
           case 4:
            t._beganPos > curPos ? t.prePage(timeInSecond) : t.nextPage(timeInSecond);
            break;

           case 2:
           case 3:
            t._beganPos < curPos ? t.prePage(timeInSecond) : t.nextPage(timeInSecond);
          }
        } else t.elasticTop <= 0 && t.elasticRight <= 0 && t.elasticBottom <= 0 && t.elasticLeft <= 0 && t.adhere();
        t._beganPos = null;
      };
      List.prototype.adhere = function() {
        var t = this;
        if (!t.checkInited()) return;
        if (t.elasticTop > 0 || t.elasticRight > 0 || t.elasticBottom > 0 || t.elasticLeft > 0) return;
        t.adhering = true;
        t._calcNearestItem();
        var offset = (t._sizeType ? t._topGap : t._leftGap) / (t._sizeType ? t.node.height : t.node.width);
        var timeInSecond = .7;
        t.scrollTo(t.nearestListId, timeInSecond, offset);
      };
      List.prototype.update = function(dt) {
        if (this.frameByFrameRenderNum <= 0 || this._updateDone) return;
        if (this._virtual) {
          var len = this._updateCounter + this.frameByFrameRenderNum > this.displayItemNum ? this.displayItemNum : this._updateCounter + this.frameByFrameRenderNum;
          for (var n = this._updateCounter; n < len; n++) {
            var data = this.displayData[n];
            data && this._createOrUpdateItem(data);
          }
          if (this._updateCounter >= this.displayItemNum - 1) if (this._doneAfterUpdate) {
            this._updateCounter = 0;
            this._updateDone = false;
            this._scrollView.isScrolling() || (this._doneAfterUpdate = false);
          } else {
            this._updateDone = true;
            this._delRedundantItem();
            this._forceUpdate = false;
            this._calcNearestItem();
            this.slideMode == SlideType.PAGE && (this.curPageNum = this.nearestListId);
          } else this._updateCounter += this.frameByFrameRenderNum;
        } else if (this._updateCounter < this._numItems) {
          var len = this._updateCounter + this.frameByFrameRenderNum > this._numItems ? this._numItems : this._updateCounter + this.frameByFrameRenderNum;
          for (var n = this._updateCounter; n < len; n++) this._createOrUpdateItem2(n);
          this._updateCounter += this.frameByFrameRenderNum;
        } else {
          this._updateDone = true;
          this._calcNearestItem();
          this.slideMode == SlideType.PAGE && (this.curPageNum = this.nearestListId);
        }
      };
      List.prototype._createOrUpdateItem = function(data) {
        var item = this.getItemByListId(data.id);
        if (item) {
          if (this._forceUpdate && this.renderEvent) {
            item.setPosition(cc.v2(data.x, data.y));
            this._resetItemSize(item);
            this.renderEvent && cc.Component.EventHandler.emitEvents([ this.renderEvent ], item, data.id % this._actualNumItems);
          }
        } else {
          var canGet = this._pool.size() > 0;
          item = canGet ? this._pool.get() : cc.instantiate(this._itemTmp);
          if (item._listId != data.id) {
            item._listId = data.id;
            item.setContentSize(this._itemSize);
          }
          item.setPosition(cc.v2(data.x, data.y));
          this._resetItemSize(item);
          this.content.addChild(item);
          if (canGet && this._needUpdateWidget) {
            var widget = item.getComponent(cc.Widget);
            widget && widget.updateAlignment();
          }
          item.setSiblingIndex(this.content.childrenCount - 1);
          var listItem = item.getComponent(ListItem_1.default);
          item["listItem"] = listItem;
          if (listItem) {
            listItem.listId = data.id;
            listItem.list = this;
            listItem._registerEvent();
          }
          this.renderEvent && cc.Component.EventHandler.emitEvents([ this.renderEvent ], item, data.id % this._actualNumItems);
        }
        this._resetItemSize(item);
        this._updateListItem(item["listItem"]);
        this._lastDisplayData.indexOf(data.id) < 0 && this._lastDisplayData.push(data.id);
      };
      List.prototype._createOrUpdateItem2 = function(listId) {
        var item = this.content.children[listId];
        var listItem;
        if (item) {
          if (this._forceUpdate && this.renderEvent) {
            item._listId = listId;
            listItem && (listItem.listId = listId);
            this.renderEvent && cc.Component.EventHandler.emitEvents([ this.renderEvent ], item, listId);
          }
        } else {
          item = cc.instantiate(this._itemTmp);
          item._listId = listId;
          this.content.addChild(item);
          listItem = item.getComponent(ListItem_1.default);
          item["listItem"] = listItem;
          if (listItem) {
            listItem.listId = listId;
            listItem.list = this;
            listItem._registerEvent();
          }
          this.renderEvent && cc.Component.EventHandler.emitEvents([ this.renderEvent ], item, listId);
        }
        this._updateListItem(listItem);
        this._lastDisplayData.indexOf(listId) < 0 && this._lastDisplayData.push(listId);
      };
      List.prototype._updateListItem = function(listItem) {
        if (!listItem) return;
        if (this.selectedMode > SelectedType.NONE) switch (this.selectedMode) {
         case SelectedType.SINGLE:
          listItem.selected = this.selectedId == listItem.node["_listId"];
          break;

         case SelectedType.MULT:
          listItem.selected = this.multSelected.indexOf(listItem.node["_listId"]) >= 0;
        }
      };
      List.prototype._resetItemSize = function(item) {
        return;
        var size;
      };
      List.prototype._updateItemPos = function(listIdOrItem) {
        var item = isNaN(listIdOrItem) ? listIdOrItem : this.getItemByListId(listIdOrItem);
        var pos = this.getItemPos(item["_listId"]);
        item.setPosition(pos.x, pos.y);
      };
      List.prototype.setMultSelected = function(args, bool) {
        var t = this;
        if (!t.checkInited()) return;
        Array.isArray(args) || (args = [ args ]);
        if (null == bool) t.multSelected = args; else {
          var listId = void 0, sub = void 0;
          if (bool) for (var n = args.length - 1; n >= 0; n--) {
            listId = args[n];
            sub = t.multSelected.indexOf(listId);
            sub < 0 && t.multSelected.push(listId);
          } else for (var n = args.length - 1; n >= 0; n--) {
            listId = args[n];
            sub = t.multSelected.indexOf(listId);
            sub >= 0 && t.multSelected.splice(sub, 1);
          }
        }
        t._forceUpdate = true;
        t._onScrolling();
      };
      List.prototype.updateItem = function(args) {
        if (!this.checkInited()) return;
        Array.isArray(args) || (args = [ args ]);
        for (var n = 0, len = args.length; n < len; n++) {
          var listId = args[n];
          var item = this.getItemByListId(listId);
          item && cc.Component.EventHandler.emitEvents([ this.renderEvent ], item, listId % this._actualNumItems);
        }
      };
      List.prototype.updateAll = function() {
        if (!this.checkInited()) return;
        this.numItems = this.numItems;
      };
      List.prototype.getItemByListId = function(listId) {
        for (var n = this.content.childrenCount - 1; n >= 0; n--) if (this.content.children[n]["_listId"] == listId) return this.content.children[n];
      };
      List.prototype._getOutsideItem = function() {
        var item, isOutside;
        var result = [];
        for (var n = this.content.childrenCount - 1; n >= 0; n--) {
          item = this.content.children[n];
          isOutside = true;
          if (isOutside) for (var c = this.displayItemNum - 1; c >= 0; c--) {
            if (!this.displayData[c]) continue;
            var listId = this.displayData[c].id;
            if (item["_listId"] == listId) {
              isOutside = false;
              break;
            }
          }
          isOutside && result.push(item);
        }
        return result;
      };
      List.prototype._delRedundantItem = function() {
        if (this._virtual) {
          var arr = this._getOutsideItem();
          for (var n = arr.length - 1; n >= 0; n--) {
            var item = arr[n];
            if (this._scrollItem && item["_listId"] == this._scrollItem["_listId"]) continue;
            this._pool.put(item);
          }
        } else while (this.content.childrenCount > this._numItems) this._delSingleItem(this.content.children[this.content.childrenCount - 1]);
      };
      List.prototype._delSingleItem = function(item) {
        item.removeFromParent();
        item.destroy && item.destroy();
        item = null;
      };
      List.prototype.aniDelItem = function(listId, callFunc, aniType) {
        var t = this;
        if (!t.checkInited() || t.cyclic || !t._virtual) return cc.error("This function is not allowed to be called!");
        if (t._aniDelRuning) return cc.warn("Please wait for the current deletion to finish!");
        var item = t.getItemByListId(listId);
        var listItem;
        if (!item) {
          callFunc(listId);
          return;
        }
        listItem = item.getComponent(ListItem_1.default);
        t._aniDelRuning = true;
        var curLastId = t.displayData[t.displayData.length - 1].id;
        var resetSelectedId = listItem.selected;
        listItem.showAni(aniType, function() {
          var newId;
          curLastId < t._numItems - 2 && (newId = curLastId + 1);
          if (null != newId) {
            var newData = t._calcItemPos(newId);
            t.displayData.push(newData);
            t._virtual ? t._createOrUpdateItem(newData) : t._createOrUpdateItem2(newId);
          } else t._numItems--;
          if (t.selectedMode == SelectedType.SINGLE) resetSelectedId ? t._selectedId = -1 : t._selectedId - 1 >= 0 && t._selectedId--; else if (t.selectedMode == SelectedType.MULT && t.multSelected.length) {
            var sub = t.multSelected.indexOf(listId);
            sub >= 0 && t.multSelected.splice(sub, 1);
            for (var n = t.multSelected.length - 1; n >= 0; n--) {
              var id = t.multSelected[n];
              id >= listId && t.multSelected[n]--;
            }
          }
          if (t._customSize) {
            t._customSize[listId] && delete t._customSize[listId];
            var newCustomSize = {};
            var size = void 0;
            for (var id in t._customSize) {
              size = t._customSize[id];
              var idNumber = parseInt(id);
              newCustomSize[idNumber - (idNumber >= listId ? 1 : 0)] = size;
            }
            t._customSize = newCustomSize;
          }
          var sec = .2333;
          var acts, haveCB;
          for (var n = null != newId ? newId : curLastId; n >= listId + 1; n--) {
            item = t.getItemByListId(n);
            if (item) {
              var posData = t._calcItemPos(n - 1);
              acts = [ cc.moveTo(sec, cc.v2(posData.x, posData.y)) ];
              if (n <= listId + 1) {
                haveCB = true;
                acts.push(cc.callFunc(function() {
                  t._aniDelRuning = false;
                  callFunc(listId);
                }));
              }
              acts.length > 1 ? item.runAction(cc.sequence(acts)) : item.runAction(acts[0]);
            }
          }
          if (!haveCB) {
            t._aniDelRuning = false;
            callFunc(listId);
          }
        }, true);
      };
      List.prototype.scrollTo = function(listId, timeInSecond, offset, overStress) {
        void 0 === timeInSecond && (timeInSecond = .5);
        void 0 === offset && (offset = null);
        void 0 === overStress && (overStress = false);
        var t = this;
        if (!t.checkInited(false)) return;
        null == timeInSecond ? timeInSecond = .5 : timeInSecond < 0 && (timeInSecond = 0);
        listId < 0 ? listId = 0 : listId >= t._numItems && (listId = t._numItems - 1);
        !t._virtual && t._layout && t._layout.enabled && t._layout.updateLayout();
        var pos = t.getItemPos(listId);
        var targetX, targetY;
        switch (t._alignCalcType) {
         case 1:
          targetX = pos.left;
          targetX -= null != offset ? t.node.width * offset : t._leftGap;
          pos = cc.v2(targetX, 0);
          break;

         case 2:
          targetX = pos.right - t.node.width;
          targetX += null != offset ? t.node.width * offset : t._rightGap;
          pos = cc.v2(targetX + t.content.width, 0);
          break;

         case 3:
          targetY = pos.top;
          targetY += null != offset ? t.node.height * offset : t._topGap;
          pos = cc.v2(0, -targetY);
          break;

         case 4:
          targetY = pos.bottom + t.node.height;
          targetY -= null != offset ? t.node.height * offset : t._bottomGap;
          pos = cc.v2(0, -targetY + t.content.height);
        }
        var viewPos = t.content.getPosition();
        viewPos = Math.abs(t._sizeType ? viewPos.y : viewPos.x);
        var comparePos = t._sizeType ? pos.y : pos.x;
        var runScroll = Math.abs((null != t._scrollPos ? t._scrollPos : viewPos) - comparePos) > .5;
        if (runScroll) {
          t._scrollView.scrollToOffset(pos, timeInSecond);
          t._scrollToListId = listId;
          t._scrollToEndTime = new Date().getTime() / 1e3 + timeInSecond;
          t._scrollToSo = t.scheduleOnce(function() {
            t._adheringBarrier || (t.adhering = t._adheringBarrier = false);
            t._scrollPos = t._scrollToListId = t._scrollToEndTime = t._scrollToSo = null;
            if (overStress) {
              var item = t.getItemByListId(listId);
              item && item.runAction(cc.sequence(cc.scaleTo(.1, 1.05), cc.scaleTo(.1, 1)));
            }
          }, timeInSecond + .1);
          timeInSecond <= 0 && t._onScrolling();
        }
      };
      List.prototype._calcNearestItem = function() {
        var t = this;
        t.nearestListId = null;
        var data, center;
        t._virtual && t._calcViewPos();
        var vTop, vRight, vBottom, vLeft;
        vTop = t.viewTop;
        vRight = t.viewRight;
        vBottom = t.viewBottom;
        vLeft = t.viewLeft;
        var breakFor = false;
        for (var n = 0; n < t.content.childrenCount && !breakFor; n += t._colLineNum) {
          data = t._virtual ? t.displayData[n] : t._calcExistItemPos(n);
          center = t._sizeType ? (data.top + data.bottom) / 2 : center = (data.left + data.right) / 2;
          switch (t._alignCalcType) {
           case 1:
            if (data.right >= vLeft) {
              t.nearestListId = data.id;
              vLeft > center && (t.nearestListId += t._colLineNum);
              breakFor = true;
            }
            break;

           case 2:
            if (data.left <= vRight) {
              t.nearestListId = data.id;
              vRight < center && (t.nearestListId += t._colLineNum);
              breakFor = true;
            }
            break;

           case 3:
            if (data.bottom <= vTop) {
              t.nearestListId = data.id;
              vTop < center && (t.nearestListId += t._colLineNum);
              breakFor = true;
            }
            break;

           case 4:
            if (data.top >= vBottom) {
              t.nearestListId = data.id;
              vBottom > center && (t.nearestListId += t._colLineNum);
              breakFor = true;
            }
          }
        }
        data = t._virtual ? t.displayData[t.displayItemNum - 1] : t._calcExistItemPos(t._numItems - 1);
        if (data && data.id == t._numItems - 1) {
          center = t._sizeType ? (data.top + data.bottom) / 2 : center = (data.left + data.right) / 2;
          switch (t._alignCalcType) {
           case 1:
            vRight > center && (t.nearestListId = data.id);
            break;

           case 2:
            vLeft < center && (t.nearestListId = data.id);
            break;

           case 3:
            vBottom < center && (t.nearestListId = data.id);
            break;

           case 4:
            vTop > center && (t.nearestListId = data.id);
          }
        }
      };
      List.prototype.prePage = function(timeInSecond) {
        void 0 === timeInSecond && (timeInSecond = .5);
        if (!this.checkInited()) return;
        this.skipPage(this.curPageNum - 1, timeInSecond);
      };
      List.prototype.nextPage = function(timeInSecond) {
        void 0 === timeInSecond && (timeInSecond = .5);
        if (!this.checkInited()) return;
        this.skipPage(this.curPageNum + 1, timeInSecond);
      };
      List.prototype.skipPage = function(pageNum, timeInSecond) {
        var t = this;
        if (!t.checkInited()) return;
        if (t._slideMode != SlideType.PAGE) return cc.error("This function is not allowed to be called, Must SlideMode = PAGE!");
        if (pageNum < 0 || pageNum >= t._numItems) return;
        if (t.curPageNum == pageNum) return;
        t.curPageNum = pageNum;
        t.pageChangeEvent && cc.Component.EventHandler.emitEvents([ t.pageChangeEvent ], pageNum);
        t.scrollTo(pageNum, timeInSecond);
      };
      List.prototype.calcCustomSize = function(numItems) {
        var t = this;
        if (!t.checkInited()) return;
        if (!t._itemTmp) return cc.error("Unset template item!");
        if (!t.renderEvent) return cc.error("Unset Render-Event!");
        t._customSize = {};
        var temp = cc.instantiate(t._itemTmp);
        t.content.addChild(temp);
        for (var n = 0; n < numItems; n++) {
          cc.Component.EventHandler.emitEvents([ t.renderEvent ], temp, n);
          temp.height == t._itemSize.height && temp.width == t._itemSize.width || (t._customSize[n] = t._sizeType ? temp.height : temp.width);
        }
        Object.keys(t._customSize).length || (t._customSize = null);
        temp.removeFromParent();
        temp.destroy && temp.destroy();
        return t._customSize;
      };
      List.prototype.getPages = function() {
        var t = this;
        t.arr = [];
        t.arr.length = t.numItems;
        return t.arr;
      };
      __decorate([ property({
        type: cc.Enum(TemplateType),
        tooltip: false
      }) ], List.prototype, "templateType", void 0);
      __decorate([ property({
        type: cc.Node,
        tooltip: false,
        visible: function() {
          return this.templateType == TemplateType.NODE;
        }
      }) ], List.prototype, "tmpNode", void 0);
      __decorate([ property({
        type: cc.Prefab,
        tooltip: false,
        visible: function() {
          return this.templateType == TemplateType.PREFAB;
        }
      }) ], List.prototype, "tmpPrefab", void 0);
      __decorate([ property() ], List.prototype, "_slideMode", void 0);
      __decorate([ property({
        type: cc.Enum(SlideType),
        tooltip: false
      }) ], List.prototype, "slideMode", null);
      __decorate([ property({
        type: cc.PageViewIndicator,
        tooltip: false,
        visible: function() {
          var bool = this._slideMode == SlideType.PAGE;
          bool || (this.pageViewIndicator = null);
          return bool;
        }
      }) ], List.prototype, "pageViewIndicator", void 0);
      __decorate([ property({
        type: cc.Float,
        range: [ 0, 1, .1 ],
        tooltip: false,
        slide: true,
        visible: function() {
          return this._slideMode == SlideType.PAGE;
        }
      }) ], List.prototype, "pageDistance", void 0);
      __decorate([ property({
        type: cc.Component.EventHandler,
        tooltip: false,
        visible: function() {
          return this._slideMode == SlideType.PAGE;
        }
      }) ], List.prototype, "pageChangeEvent", void 0);
      __decorate([ property() ], List.prototype, "_virtual", void 0);
      __decorate([ property({
        type: cc.Boolean,
        tooltip: false
      }) ], List.prototype, "virtual", null);
      __decorate([ property({
        tooltip: false,
        visible: function() {
          var val = this.virtual && this.slideMode == SlideType.NORMAL;
          val || (this.cyclic = false);
          return val;
        }
      }) ], List.prototype, "cyclic", void 0);
      __decorate([ property({
        tooltip: false,
        visible: function() {
          return this.virtual;
        }
      }) ], List.prototype, "lackCenter", void 0);
      __decorate([ property({
        tooltip: false,
        visible: function() {
          var val = this.virtual && !this.lackCenter;
          val || (this.lackSlide = false);
          return val;
        }
      }) ], List.prototype, "lackSlide", void 0);
      __decorate([ property({
        type: cc.Integer
      }) ], List.prototype, "_updateRate", void 0);
      __decorate([ property({
        type: cc.Integer,
        range: [ 0, 6, 1 ],
        tooltip: false,
        slide: true
      }) ], List.prototype, "updateRate", null);
      __decorate([ property({
        type: cc.Integer,
        range: [ 0, 12, 1 ],
        tooltip: false,
        slide: true
      }) ], List.prototype, "frameByFrameRenderNum", void 0);
      __decorate([ property({
        type: cc.Component.EventHandler,
        tooltip: false
      }) ], List.prototype, "renderEvent", void 0);
      __decorate([ property({
        type: cc.Enum(SelectedType),
        tooltip: false
      }) ], List.prototype, "selectedMode", void 0);
      __decorate([ property({
        tooltip: false,
        visible: function() {
          return this.selectedMode == SelectedType.SINGLE;
        }
      }) ], List.prototype, "repeatEventSingle", void 0);
      __decorate([ property({
        type: cc.Component.EventHandler,
        tooltip: false,
        visible: function() {
          return this.selectedMode > SelectedType.NONE;
        }
      }) ], List.prototype, "selectedEvent", void 0);
      __decorate([ property({
        serializable: false
      }) ], List.prototype, "_numItems", void 0);
      List = __decorate([ ccclass, disallowMultiple(), menu("\u81ea\u5b9a\u4e49\u7ec4\u4ef6/List"), requireComponent(cc.ScrollView), executionOrder(-5e3) ], List);
      return List;
    }(cc.Component);
    exports.default = List;
    cc._RF.pop();
  }, {
    "./ListItem": "ListItem"
  } ],
  LoadGuide: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "221183HlFFC8a1pFSY4mraA", "LoadGuide");
    "use strict";
    var async = require("async");
    cc.Class({
      extends: cc.Component,
      properties: {
        PREFAB: cc.Prefab,
        parent: cc.Node,
        zIndex: 999
      },
      onLoad: function onLoad() {},
      start: function start() {},
      loadPrefab: function loadPrefab() {
        if (!this._godGuide) try {
          var node = cc.instantiate(this.PREFAB);
          node.zIndex = this.zIndex;
          node.position = cc.v2(0, 0);
          node._objFlags = cc.Object.Flags.DontSave;
          node.parent = this.parent || this.node;
          this._godGuide = node.getComponent("GodGuide");
        } catch (error) {
          cc.error(this.PREFAB);
          cc.error(error);
        }
      },
      runTask: function runTask(taskArr) {
        var _this = this;
        var mainsceneMng = require("MainSceneMng")["default"];
        if (null != this.tasks) return;
        this.tasks = taskArr;
        mainsceneMng.instance.isShowingGuide = true;
        this._godGuide || this.loadPrefab();
        async.eachSeries(taskArr, function(taskFile, cb) {
          var task = require(taskFile);
          _this._godGuide.setTask(task);
          _this._godGuide.run(cb);
        }, function() {
          cc.log("\u4efb\u52a1\u5168\u90e8\u5b8c\u6210");
          _this.tasks = null;
          mainsceneMng.instance.isShowingGuide = false;
        });
      }
    });
    cc._RF.pop();
  }, {
    MainSceneMng: void 0,
    async: "async"
  } ],
  Log: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "67d10ZYkcdBfIDdzvWV7o0w", "Log");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.LOG_TAG = {
      SOCKET: {
        desc: "LOG_SOCKET",
        isOpen: true
      },
      TEST: {
        desc: "LOG_TEST",
        isOpen: false
      },
      LOAD: {
        desc: "LOG_LOAD",
        isOpen: false
      },
      ACTOR: {
        desc: "LOG_ACTOR",
        isOpen: false
      },
      DEV: {
        desc: "LOG_DEV",
        isOpen: true,
        codePos: false
      }
    };
    var TagArr = Object.values(exports.LOG_TAG);
    false;
    var Log = function() {
      function Log() {}
      Log.log = function(tag) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) args[_i - 1] = arguments[_i];
        var backLog = console.log || cc.log;
        var data = null;
        if (!TagArr.includes(tag)) {
          data = tag;
          tag = exports.LOG_TAG.DEV;
        }
        if (!tag || !tag.isOpen) return;
        var arr = Array.prototype.slice.call(arguments);
        arr.splice(0, 1, "[" + tag.desc + "]");
        var info = Log.stack(2) + Log.getDateString() + " ";
        arr.splice(1, 0, info);
        data && arr.splice(2, 0, data);
        backLog.apply(backLog, arr);
        var pos = "%cCodePos:" + Log.stackPos();
        tag.codePos && console.log(pos, "color: #6190e8;");
      };
      Log.warn = function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
        var backLog = console.warn || cc.warn;
        var arr = Array.prototype.slice.call(arguments);
        var info = Log.stack(2) + Log.getDateString() + " ";
        arr.splice(0, 0, info);
        backLog.apply(backLog, arr);
      };
      Log.error = function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
        var backLog = console.error || cc.error;
        var arr = Array.prototype.slice.call(arguments);
        var info = Log.stack(2) + Log.getDateString() + " ";
        arr.splice(0, 0, info);
        backLog.apply(backLog, arr);
      };
      Log.getDateString = function() {
        var d = new Date();
        var str = d.getHours().toString();
        var timeStr = "";
        timeStr += (1 == str.length ? "0" + str : str) + ":";
        str = d.getMinutes().toString();
        timeStr += (1 == str.length ? "0" + str : str) + ":";
        str = d.getSeconds().toString();
        timeStr += (1 == str.length ? "0" + str : str) + ":";
        str = d.getMilliseconds().toString();
        1 == str.length && (str = "00" + str);
        2 == str.length && (str = "0" + str);
        timeStr += str;
        timeStr = "[" + timeStr + "]";
        return timeStr;
      };
      Log.stack = function(index) {
        void 0 === index && (index = 2);
        var e = new Error();
        var lines = e.stack.split("\n");
        lines.shift();
        var result = [];
        lines.forEach(function(line) {
          var _a;
          line = line.substring(7);
          var lineBreak = line.split(" ");
          lineBreak.length < 2 ? result.push(lineBreak[0]) : result.push((_a = {}, _a[lineBreak[0]] = lineBreak[1], 
          _a));
        });
        var list = [];
        if (index < result.length - 1) for (var a in result[index]) list.push(a);
        var splitList = list[0] ? list[0].split(".") : "unknow";
        return splitList[0] + ".js->" + splitList[1] + ":";
      };
      Log.stackPos = function(index) {
        void 0 === index && (index = 2);
        var e = new Error();
        var lines = e.stack.split("\n");
        lines.shift();
        var url = lines[index];
        var index1 = url.indexOf("(");
        var index2 = url.indexOf(")");
        return url.substring(index1 + 1, index2);
      };
      return Log;
    }();
    exports.Log = Log;
    false;
    false;
    exports.LOG_TAG.DEV.isOpen = false;
    cc._RF.pop();
  }, {} ],
  Message: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "b46c3DYwuFG65EpxWaxCAPI", "Message");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var CMessageRegister = function() {
      function CMessageRegister() {
        this.tMsg = {};
        this.tClass = {};
      }
      CMessageRegister.prototype.registerMsg = function(fileMsgObj) {
        for (var msgName in fileMsgObj) this.tMsg[msgName] = fileMsgObj[msgName];
      };
      CMessageRegister.prototype.getMsg = function(messageName) {
        if (this.tMsg.hasOwnProperty(messageName)) return this.tMsg[messageName];
        console.error("\u627e\u4e0d\u5230\u6d88\u606f\u540d\u4e3a" + messageName + "\u7684\u6d88\u606f");
        return null;
      };
      CMessageRegister.prototype.registerClass = function(protocolType, classType) {
        if (protocolType < 0) return;
        this.tClass[protocolType] = classType;
      };
      CMessageRegister.prototype.getClass = function(protocolType) {
        if (this.tClass.hasOwnProperty(protocolType)) return this.tClass[protocolType];
        console.error("\u627e\u4e0d\u5230\u534f\u8bae\u53f7" + protocolType + "\u5bf9\u5e94\u7684class");
        return null;
      };
      return CMessageRegister;
    }();
    exports.MessageRegister = new CMessageRegister();
    var CMessageBase = function() {
      function CMessageBase() {}
      CMessageBase.prototype.initMsgObj = function(databuff) {
        var MSG = exports.MessageRegister.getMsg(this.messageName);
        if (!MSG) {
          console.error("MSG\u4e3a\u7a7a");
          return;
        }
        this.msgObj = databuff ? MSG.decode(databuff) : new MSG();
      };
      CMessageBase.prototype.getType = function() {
        return this.protocolType;
      };
      CMessageBase.prototype.getName = function() {
        return this.messageName;
      };
      CMessageBase.prototype.toArrayBuffer = function() {
        return this.msgObj.toArrayBuffer();
      };
      CMessageBase.prototype.getMsg = function() {
        return this.msgObj;
      };
      return CMessageBase;
    }();
    exports.CMessageBase = CMessageBase;
    cc._RF.pop();
  }, {} ],
  MultiResoultionCompat: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "b6c42Wz64tDYYqUBUbC2YRW", "MultiResoultionCompat");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var MultiResolutionCompat = function(_super) {
      __extends(MultiResolutionCompat, _super);
      function MultiResolutionCompat() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      MultiResolutionCompat_1 = MultiResolutionCompat;
      MultiResolutionCompat.prototype.onLoad = function() {
        cc.view.setDesignResolutionSize(MultiResolutionCompat_1.DEFAULT_RESOLUTION_WIDTH, MultiResolutionCompat_1.DEFAULT_RESOLUTION_HEIGHT, cc.ResolutionPolicy.SHOW_ALL);
      };
      MultiResolutionCompat.getShowAllModeScale = function() {
        return Math.min(cc.view.getCanvasSize().width / this.DEFAULT_RESOLUTION_WIDTH, cc.view.getCanvasSize().height / this.DEFAULT_RESOLUTION_HEIGHT);
      };
      MultiResolutionCompat.getShowAllModeRealHeight = function() {
        return this.DEFAULT_RESOLUTION_HEIGHT * this.getShowAllModeScale();
      };
      MultiResolutionCompat.getShowAllModeRealWidth = function() {
        return this.DEFAULT_RESOLUTION_WIDTH * this.getShowAllModeScale();
      };
      MultiResolutionCompat.getShowAllModeVerticalBorderHeight = function() {
        return cc.view.getCanvasSize().height - this.getShowAllModeRealHeight();
      };
      MultiResolutionCompat.getShowAllModeHorizontalBorderWidth = function() {
        return cc.view.getCanvasSize().width - this.getShowAllModeRealWidth();
      };
      MultiResolutionCompat.getShowAllModeNodePositionCloseToBottom = function(nodePosInDesign) {
        var srcScaleForShowAll = MultiResolutionCompat_1.getShowAllModeScale();
        var bottomBorderHeightInCanvas = MultiResolutionCompat_1.getShowAllModeVerticalBorderHeight() / 2;
        var srcNodePosYInCanvas = nodePosInDesign.y * srcScaleForShowAll;
        var finalNodePosYInCanvas = srcNodePosYInCanvas - bottomBorderHeightInCanvas;
        var nodePosYInDesign = finalNodePosYInCanvas / srcScaleForShowAll;
        return cc.v2(nodePosInDesign.x, nodePosYInDesign);
      };
      MultiResolutionCompat.convertNodePosInDesignToNodePosInCanvas = function(nodePosInDesign) {
        return nodePosInDesign.sub(cc.v2(this.getShowAllModeScale(), this.getShowAllModeScale()));
      };
      MultiResolutionCompat.convertNodePosInCanvasToNodePosInDesign = function(nodePosInCanvas) {
        return nodePosInCanvas.div(cc.v2(this.getShowAllModeScale(), this.getShowAllModeScale()));
      };
      MultiResolutionCompat.convertWidthInDesignToWidthInCanvas = function(widthInDesign) {
        return widthInDesign * this.getShowAllModeScale();
      };
      MultiResolutionCompat.convertWidthInCanvasToWidthInDesign = function(widthInCanvas) {
        return widthInCanvas / this.getShowAllModeScale();
      };
      MultiResolutionCompat.convertHeightInDesignToHeightInCanvas = function(heightInDesign) {
        return heightInDesign * this.getShowAllModeScale();
      };
      MultiResolutionCompat.convertHeightInCanvasToHeightInDesign = function(heightIncanvas) {
        return heightIncanvas / this.getShowAllModeScale();
      };
      var MultiResolutionCompat_1;
      MultiResolutionCompat.DEFAULT_RESOLUTION_WIDTH = 720;
      MultiResolutionCompat.DEFAULT_RESOLUTION_HEIGHT = 1280;
      MultiResolutionCompat = MultiResolutionCompat_1 = __decorate([ ccclass ], MultiResolutionCompat);
      return MultiResolutionCompat;
    }(cc.Component);
    exports.default = MultiResolutionCompat;
    cc._RF.pop();
  }, {} ],
  NetInterface: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f9feaocloNC6LDFqBfwC8bY", "NetInterface");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ProtoMessage_1 = require("../../../ProtoMessage");
    var DefStringProtocol = function() {
      function DefStringProtocol() {}
      DefStringProtocol.prototype.getHeadlen = function() {
        return 0;
      };
      DefStringProtocol.prototype.getHearbeat = function() {
        var hearbeat = new ProtoMessage_1.C2G_Heat_beat();
        hearbeat.msg = "test";
        return hearbeat;
      };
      DefStringProtocol.prototype.getPackageLen = function(msg) {
        return msg.toString().length;
      };
      DefStringProtocol.prototype.checkPackage = function(msg) {
        return true;
      };
      DefStringProtocol.prototype.getPackageId = function(msg) {
        return 0;
      };
      return DefStringProtocol;
    }();
    exports.DefStringProtocol = DefStringProtocol;
    cc._RF.pop();
  }, {
    "../../../ProtoMessage": "ProtoMessage"
  } ],
  NetMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d7d57ZrkGtM7L9f1FpyY1Xs", "NetMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var NetNode_1 = require("../main/network/NetNode");
    var NetInterface_1 = require("../main/network/NetInterface");
    var Socket_1 = require("../main/network/Socket");
    var NetMng = function() {
      function NetMng() {
        this._channels = {};
        var netNode = new NetNode_1.NetNode();
        var protocol = new NetInterface_1.DefStringProtocol();
        netNode.init(new Socket_1.WebSock(), protocol);
        this.setNetNode(netNode);
      }
      NetMng.prototype.setNetNode = function(newNode, channelId) {
        void 0 === channelId && (channelId = 0);
        this._channels[channelId] = newNode;
      };
      NetMng.prototype.removeNetNode = function(channelId) {
        delete this._channels[channelId];
      };
      NetMng.prototype.connect = function(options, channelId) {
        void 0 === channelId && (channelId = 0);
        if (this._channels[channelId]) return this._channels[channelId].connect(options);
        return false;
      };
      NetMng.prototype.send = function(buf, force, channelId) {
        void 0 === force && (force = false);
        void 0 === channelId && (channelId = 0);
        var node = this._channels[channelId];
        if (node) return node.send(buf, force);
        return false;
      };
      NetMng.prototype.request = function(buf, rspCmd, rspObject, showTips, force, channelId) {
        void 0 === showTips && (showTips = true);
        void 0 === force && (force = false);
        void 0 === channelId && (channelId = 0);
        var node = this._channels[channelId];
        node && node.request(buf, rspCmd, rspObject, showTips, force);
      };
      NetMng.prototype.requestUnique = function(buf, rspCmd, rspObject, showTips, force, channelId) {
        void 0 === showTips && (showTips = true);
        void 0 === force && (force = false);
        void 0 === channelId && (channelId = 0);
        var node = this._channels[channelId];
        if (node) return node.requestUnique(buf, rspCmd, rspObject, showTips, force);
        return false;
      };
      NetMng.prototype.close = function(code, reason, channelId) {
        void 0 === channelId && (channelId = 0);
        if (this._channels[channelId]) return this._channels[channelId].closeSocket(code, reason);
      };
      return NetMng;
    }();
    exports.default = new NetMng();
    cc._RF.pop();
  }, {
    "../main/network/NetInterface": "NetInterface",
    "../main/network/NetNode": "NetNode",
    "../main/network/Socket": "Socket"
  } ],
  NetNode: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2b99curBI1IYp2RJVDSRsfq", "NetNode");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var Log_1 = require("../utils/Log");
    var UIHelp_1 = require("../ui/UIHelp");
    var EventMng_1 = require("../../manager/EventMng");
    var EventConst_1 = require("../../const/EventConst");
    var Message_1 = require("./Message");
    var NetTipsType;
    (function(NetTipsType) {
      NetTipsType[NetTipsType["Connecting"] = 0] = "Connecting";
      NetTipsType[NetTipsType["ReConnecting"] = 1] = "ReConnecting";
      NetTipsType[NetTipsType["Requesting"] = 2] = "Requesting";
    })(NetTipsType = exports.NetTipsType || (exports.NetTipsType = {}));
    var NetNodeState;
    (function(NetNodeState) {
      NetNodeState[NetNodeState["Closed"] = 0] = "Closed";
      NetNodeState[NetNodeState["Connecting"] = 1] = "Connecting";
      NetNodeState[NetNodeState["Checking"] = 2] = "Checking";
      NetNodeState[NetNodeState["Working"] = 3] = "Working";
    })(NetNodeState = exports.NetNodeState || (exports.NetNodeState = {}));
    var DATA_TOTAL_LEN = 4;
    var PROTOCOLTYPE_LEN = 4;
    var NetNode = function() {
      function NetNode() {
        this._connectOptions = null;
        this._autoReconnect = 0;
        this._isSocketInit = false;
        this._isSocketOpen = false;
        this._state = NetNodeState.Closed;
        this._socket = null;
        this._networkTips = null;
        this._protocolHelper = null;
        this._connectedCallback = null;
        this._disconnectCallback = null;
        this._callbackExecuter = null;
        this._keepAliveTimer = null;
        this._receiveMsgTimer = null;
        this._reconnectTimer = null;
        this._heartTime = 1e4;
        this._receiveTime = 6e6;
        this._reconnetTimeOut = 8e6;
        this._requests = Array();
        this._listener = {};
      }
      NetNode.prototype.init = function(socket, protocol, networkTips, execFunc) {
        void 0 === networkTips && (networkTips = null);
        void 0 === execFunc && (execFunc = null);
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode init socket");
        this._socket = socket;
        this._protocolHelper = protocol;
        this._networkTips = networkTips;
        this._callbackExecuter = execFunc || function(callback, buffer) {
          callback.callback.call(callback.target, 0, buffer);
        };
      };
      NetNode.prototype.connect = function(options) {
        if (this._socket && this._state == NetNodeState.Closed) {
          this._isSocketInit || this.initSocket();
          this._state = NetNodeState.Connecting;
          if (!this._socket.connect(options)) {
            this.updateNetTips(NetTipsType.Connecting, false);
            return false;
          }
          null == this._connectOptions && (options.autoReconnect = options.autoReconnect);
          this._connectOptions = options;
          this.updateNetTips(NetTipsType.Connecting, true);
          return true;
        }
        return false;
      };
      NetNode.prototype.initSocket = function() {
        var _this = this;
        this._socket.onConnected = function(event) {
          _this.onConnected(event);
        };
        this._socket.onMessage = function(msg) {
          _this.onMessage(msg);
        };
        this._socket.onError = function(event) {
          _this.onError(event);
        };
        this._socket.onClosed = function(event) {
          _this.onClosed(event);
        };
        this._isSocketInit = true;
      };
      NetNode.prototype.updateNetTips = function(tipsType, isShow) {
        this._networkTips && (tipsType == NetTipsType.Requesting ? this._networkTips.requestTips(isShow) : tipsType == NetTipsType.Connecting ? this._networkTips.connectTips(isShow) : tipsType == NetTipsType.ReConnecting && this._networkTips.reconnectTips(isShow));
      };
      NetNode.prototype.onConnected = function(event) {
        var _this = this;
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode onConnected!");
        this._isSocketOpen = true;
        if (null !== this._connectedCallback) {
          this._state = NetNodeState.Checking;
          this._connectedCallback(function() {
            _this.onChecked();
          });
        } else this.onChecked();
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode onConnected! state =" + this._state);
        EventMng_1.default.emit(EventConst_1.SocketEvent.SOCKET_OPEN);
      };
      NetNode.prototype.onChecked = function() {
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode onChecked!");
        this._state = NetNodeState.Working;
        this.updateNetTips(NetTipsType.Connecting, false);
        this.updateNetTips(NetTipsType.ReConnecting, false);
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode flush " + this._requests.length + " request");
        if (this._requests.length > 0) {
          for (var i = 0; i < this._requests.length; ) {
            var req = this._requests[i];
            this._socket.send(req.buffer);
            null == req.rspObject || req.rspCmd <= 0 ? this._requests.splice(i, 1) : ++i;
          }
          this.updateNetTips(NetTipsType.Requesting, this.request.length > 0);
        }
      };
      NetNode.prototype.onMessage = function(msg) {
        msg = "string" === typeof msg ? msg : this.bufferToMsg(msg);
        EventMng_1.default.emit(msg.messageName, msg);
        if (!this._protocolHelper.checkPackage(msg)) {
          console.error("NetNode checkHead Error");
          return;
        }
        this.resetReceiveMsgTimer();
        this.resetHearbeatTimer();
        var rspCmd = this._protocolHelper.getPackageId(msg);
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode onMessage rspCmd = " + rspCmd, msg);
        if (this._requests.length > 0) {
          for (var reqIdx in this._requests) {
            var req = this._requests[reqIdx];
            if (req.rspCmd == rspCmd) {
              Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode execute request rspcmd " + rspCmd);
              this._callbackExecuter(req.rspObject, msg);
              this._requests.splice(parseInt(reqIdx), 1);
              break;
            }
          }
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode still has " + this._requests.length + " request watting");
          0 == this._requests.length && this.updateNetTips(NetTipsType.Requesting, false);
        }
        var listeners = this._listener[rspCmd];
        if (null != listeners) for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {
          var rsp = listeners_1[_i];
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode execute listener cmd " + rspCmd);
          this._callbackExecuter(rsp, msg);
        }
      };
      NetNode.prototype.onError = function(errMsg) {
        var _this = this;
        errMsg && Log_1.Log.error("socket error, msg = " + errMsg);
        UIHelp_1.default.ShowDialog({
          title: "\u8054\u7f51\u5931\u8d25",
          content: "\u662f\u5426\u91cd\u65b0\u8fde\u63a5\uff1f\uff08\u8bf7\u786e\u8ba4\u670d\u52a1\u5668\u662f\u5426\u5f00\u542f\uff09",
          certainCb: function() {
            _this.connect(_this._connectOptions);
          }
        });
      };
      NetNode.prototype.onClosed = function(event) {
        var _this = this;
        this.clearTimer();
        EventMng_1.default.emit(EventConst_1.SocketEvent.SOCKET_CLOSE);
        if (this._disconnectCallback && !this._disconnectCallback()) {
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "disconnect return!");
          return;
        }
        if (this.isAutoReconnect()) {
          this.updateNetTips(NetTipsType.ReConnecting, true);
          this._reconnectTimer = setTimeout(function() {
            _this._socket.close();
            _this._state = NetNodeState.Closed;
            _this.connect(_this._connectOptions);
            _this._autoReconnect > 0 && (_this._autoReconnect -= 1);
          }, this._reconnetTimeOut);
        } else {
          this._state = NetNodeState.Closed;
          UIHelp_1.default.ShowDialog({
            title: "\u4e0e\u670d\u52a1\u5668\u94fe\u63a5\u65ad\u5f00",
            content: "\u662f\u5426\u91cd\u65b0\u8fde\u63a5\uff1f\uff08\u8bf7\u786e\u8ba4\u670d\u52a1\u5668\u662f\u5426\u5f00\u542f\uff09",
            certainCb: function() {
              _this.connect(_this._connectOptions);
            }
          });
        }
      };
      NetNode.prototype.close = function(code, reason) {
        this.clearTimer();
        this._listener = {};
        this._requests.length = 0;
        if (this._networkTips) {
          this._networkTips.connectTips(false);
          this._networkTips.reconnectTips(false);
          this._networkTips.requestTips(false);
        }
        this._socket ? this._socket.close(code, reason) : this._state = NetNodeState.Closed;
      };
      NetNode.prototype.closeSocket = function(code, reason) {
        this._socket && this._socket.close(code, reason);
      };
      NetNode.prototype.send = function(buf, force) {
        void 0 === force && (force = false);
        if (this._state == NetNodeState.Working || force) return this.sendMsg(buf);
        if (this._state == NetNodeState.Checking || this._state == NetNodeState.Connecting) {
          this._requests.push({
            buffer: buf,
            rspCmd: 0,
            rspObject: null
          });
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode socket is busy, push to send buffer, current state is " + this._state);
          return true;
        }
        console.error("NetNode request error! current state is " + this._state);
        return false;
      };
      NetNode.prototype.request = function(buf, rspCmd, rspObject, showTips, force) {
        void 0 === showTips && (showTips = true);
        void 0 === force && (force = false);
        (this._state == NetNodeState.Working || force) && this.sendMsg(buf);
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode request with timeout for " + rspCmd);
        this._requests.push({
          buffer: buf,
          rspCmd: rspCmd,
          rspObject: rspObject
        });
        showTips && this.updateNetTips(NetTipsType.Requesting, true);
      };
      NetNode.prototype.requestUnique = function(buf, rspCmd, rspObject, showTips, force) {
        void 0 === showTips && (showTips = true);
        void 0 === force && (force = false);
        for (var i = 0; i < this._requests.length; ++i) if (this._requests[i].rspCmd == rspCmd) {
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode requestUnique faile for " + rspCmd);
          return false;
        }
        this.request(buf, rspCmd, rspObject, showTips, force);
        return true;
      };
      NetNode.prototype.setResponeHandler = function(cmd, callback, target) {
        if (null == callback) {
          console.error("NetNode setResponeHandler error " + cmd);
          return false;
        }
        this._listener[cmd] = [ {
          target: target,
          callback: callback
        } ];
        return true;
      };
      NetNode.prototype.addResponeHandler = function(cmd, callback, target) {
        if (null == callback) {
          console.error("NetNode addResponeHandler error " + cmd);
          return false;
        }
        var rspObject = {
          target: target,
          callback: callback
        };
        if (null == this._listener[cmd]) this._listener[cmd] = [ rspObject ]; else {
          var index = this.getNetListenersIndex(cmd, rspObject);
          -1 == index && this._listener[cmd].push(rspObject);
        }
        return true;
      };
      NetNode.prototype.removeResponeHandler = function(cmd, callback, target) {
        if (null != this._listener[cmd] && null != callback) {
          var index = this.getNetListenersIndex(cmd, {
            target: target,
            callback: callback
          });
          -1 != index && this._listener[cmd].splice(index, 1);
        }
      };
      NetNode.prototype.cleanListeners = function(cmd) {
        void 0 === cmd && (cmd = -1);
        -1 == cmd ? this._listener = {} : this._listener[cmd] = null;
      };
      NetNode.prototype.getNetListenersIndex = function(cmd, rspObject) {
        var index = -1;
        for (var i = 0; i < this._listener[cmd].length; i++) {
          var iterator = this._listener[cmd][i];
          if (iterator.callback == rspObject.callback && iterator.target == rspObject.target) {
            index = i;
            break;
          }
        }
        return index;
      };
      NetNode.prototype.resetReceiveMsgTimer = function() {
        var _this = this;
        null !== this._receiveMsgTimer && clearTimeout(this._receiveMsgTimer);
        this._receiveMsgTimer = setTimeout(function() {
          console.warn("NetNode recvieMsgTimer close socket!");
          _this._socket.close();
        }, this._receiveTime);
      };
      NetNode.prototype.resetHearbeatTimer = function() {
        var _this = this;
        null !== this._keepAliveTimer && clearTimeout(this._keepAliveTimer);
        this._keepAliveTimer = setTimeout(function() {
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "NetNode keepAliveTimer send Hearbeat");
          _this.send(_this._protocolHelper.getHearbeat());
        }, this._heartTime);
      };
      NetNode.prototype.clearTimer = function() {
        null !== this._receiveMsgTimer && clearTimeout(this._receiveMsgTimer);
        null !== this._keepAliveTimer && clearTimeout(this._keepAliveTimer);
        null !== this._reconnectTimer && clearTimeout(this._reconnectTimer);
      };
      NetNode.prototype.isAutoReconnect = function() {
        return 0 != this._autoReconnect;
      };
      NetNode.prototype.rejectReconnect = function() {
        this._autoReconnect = 0;
        this.clearTimer();
      };
      NetNode.prototype.bufferToMsg = function(recvBuf) {
        var recvView = new DataView(recvBuf);
        var protocolType = recvView.getInt32(DATA_TOTAL_LEN);
        var msgBuf = recvBuf.slice(DATA_TOTAL_LEN + PROTOCOLTYPE_LEN, recvBuf.byteLength);
        var classType = Message_1.MessageRegister.getClass(protocolType);
        var msg = new classType(msgBuf);
        return msg;
      };
      NetNode.prototype.msgToBuffer = function(msg) {
        var protocolType = msg.protocolType;
        var dataBuf = msg.toArrayBuffer();
        var dataView = new DataView(dataBuf);
        var dataLen = dataBuf.byteLength;
        var sendBuf = new ArrayBuffer(DATA_TOTAL_LEN + PROTOCOLTYPE_LEN + dataLen);
        var sendView = new DataView(sendBuf);
        sendView.setInt32(0, PROTOCOLTYPE_LEN + dataLen);
        sendView.setInt32(DATA_TOTAL_LEN, protocolType);
        for (var i = 0; i < dataLen; i++) sendView.setInt8(PROTOCOLTYPE_LEN + DATA_TOTAL_LEN + i, dataView.getInt8(i));
        return sendBuf;
      };
      NetNode.prototype.sendMsg = function(buf) {
        Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "socket send ...", buf);
        if ("string" === typeof buf) return this._socket.send(buf);
        var sendBuf = this.msgToBuffer(buf);
        return this._socket.send(sendBuf);
      };
      return NetNode;
    }();
    exports.NetNode = NetNode;
    cc._RF.pop();
  }, {
    "../../const/EventConst": "EventConst",
    "../../manager/EventMng": "EventMng",
    "../ui/UIHelp": "UIHelp",
    "../utils/Log": "Log",
    "./Message": "Message"
  } ],
  OImageIds: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "5bffawkupRGUJwIXrj99khi", "OImageIds");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.oImageIds = {};
    exports.oImageIds.playBut = "id0";
    exports.oImageIds.creditsBut = "id1";
    exports.oImageIds.quitBut = "id2";
    exports.oImageIds.moreGamesBut = "id3";
    exports.oImageIds.quitBut = "id4";
    exports.oImageIds.upgradeBut = "id5";
    exports.oImageIds.backBut = "id6";
    exports.oImageIds.upgradeBut20On = "id7";
    exports.oImageIds.upgradeBut50On = "id8";
    exports.oImageIds.upgradeBut80On = "id9";
    exports.oImageIds.upgradeBut120On = "id10";
    exports.oImageIds.upgradeBut175On = "id11";
    exports.oImageIds.upgradeBut20Off = "id12";
    exports.oImageIds.upgradeBut50Off = "id13";
    exports.oImageIds.upgradeBut80Off = "id14";
    exports.oImageIds.upgradeBut120Off = "id15";
    exports.oImageIds.upgradeBut175Off = "id16";
    exports.oImageIds.resetDataBut = "id17";
    exports.oImageIds.horiz1 = "id0";
    exports.oImageIds.horiz2 = "id1";
    exports.oImageIds.horiz3 = "id2";
    exports.oImageIds.straightHoriz = "id3";
    exports.oImageIds.block1 = "id4";
    exports.oImageIds.block2 = "id5";
    exports.oImageIds.block3 = "id6";
    exports.oImageIds.block4 = "id7";
    exports.oImageIds.block5 = "id18";
    exports.oImageIds.block6 = "id8";
    exports.oImageIds.block7 = "id9";
    exports.oImageIds.block8 = "id10";
    exports.oImageIds.block9 = "id11";
    exports.oImageIds.block10 = "id12";
    exports.oImageIds.plant0 = "id13";
    exports.oImageIds.plant1 = "id14";
    exports.oImageIds.plant2 = "id15";
    exports.oImageIds.plant3 = "id16";
    exports.oImageIds.heroShadow = "id17";
    exports.oImageIds.chainBar0 = "id19";
    exports.oImageIds.chainBar1 = "id20";
    exports.oImageIds.chainBarGem = "id21";
    exports.oImageIds.cm = "id22";
    exports.oImageIds.upgradeBar = "id23";
    exports.oImageIds.block11 = "id24";
    exports.oImageIds.block12 = "id25";
    exports.oImageIds.block13 = "id26";
    exports.oImageIds.block14 = "id27";
    exports.oImageIds.tutMobile0 = "id28";
    exports.oImageIds.tutMobile1 = "id29";
    exports.oImageIds.tutHand = "id30";
    exports.oImageIds.tutDesktop0 = "id31";
    exports.oImageIds.tutDesktop1 = "id32";
    exports.oImageIds.turnSignRight = "id33";
    exports.oImageIds.turnSignLeft = "id34";
    exports.oImageIds.turnSignT = "id35";
    exports.actorAnimaData = {
      id: "squirrel",
      file: "images/hero_154x198.png",
      oAnims: {
        running: [ 0, 1, 2, 3, 4, 5, 6, 7 ],
        jumping: [ 0, 1, 2, 3, 8, 9, 10, 10, 11, 11, 12, 12, 12 ],
        falling: [ 13 ],
        ducking: [ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 16, 15 ],
        blocked: [ 8, 9, 10, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 ]
      }
    };
    cc._RF.pop();
  }, {} ],
  OptimizaDrawCall: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "939a0GgawNO2qyQxkQq8YXr", "OptimizaDrawCall");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, executionOrder = _a.executionOrder, help = _a.help;
    var containerZIndex = 1;
    var OptimizeDrawCallOptions = function() {
      function OptimizeDrawCallOptions() {
        this.pathToNode = [ "" ];
        this.oldLength = 1;
        this.containerZIndex = containerZIndex;
      }
      __decorate([ property({
        type: cc.String,
        displayName: "\u5f85\u4f18\u5316\u8282\u70b9\u540d",
        tooltip: "\u811a\u672c\u8282\u70b9\u4e0b\u7684\u8282\u70b9\u540d \u4f18\u5316\u8282\u70b9\u4e0d\u80fd\u91cd\u540d"
      }) ], OptimizeDrawCallOptions.prototype, "pathToNode", void 0);
      __decorate([ property({
        type: cc.Integer,
        displayName: "\u5206\u5c42\u8282\u70b9zIndex",
        tooltip: "\u5982\u5c42\u7ea7\u4e0d\u5bf9\uff0c\u53ef\u81ea\u884c\u8c03\u6574\uff0c\u4e00\u822c\u8282\u70b9\u5c42\u7ea7\u9ed8\u8ba4\u4e3a0"
      }) ], OptimizeDrawCallOptions.prototype, "containerZIndex", void 0);
      OptimizeDrawCallOptions = __decorate([ ccclass("OptimizeDrawCallOptions") ], OptimizeDrawCallOptions);
      return OptimizeDrawCallOptions;
    }();
    exports.OptimizeDrawCallOptions = OptimizeDrawCallOptions;
    var OptimizeDrawCall = function(_super) {
      __extends(OptimizeDrawCall, _super);
      function OptimizeDrawCall() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.enabledOptimize = true;
        _this._options = [ new OptimizeDrawCallOptions() ];
        return _this;
      }
      Object.defineProperty(OptimizeDrawCall.prototype, "options", {
        get: function() {
          return this._options;
        },
        set: function(value) {
          false;
          this._options = value;
        },
        enumerable: true,
        configurable: true
      });
      OptimizeDrawCall.prototype.onLoad = function() {
        cc.sys.isNative || this._setNodeRender();
      };
      OptimizeDrawCall.prototype._setNodeRender = function() {
        if (!this.enabledOptimize) return;
        var config = {};
        this.options.forEach(function(nodeInfo) {
          nodeInfo && nodeInfo.pathToNode.forEach(function(name) {
            name && (config[name] = nodeInfo.containerZIndex);
          });
        });
        var content = this.node;
        content._renderFlag &= ~cc.RenderFlow.FLAG_CHILDREN;
        content._renderFlag |= cc.RenderFlow.FLAG_CHILDREN_BATCH_RENDER;
        content.config = config;
      };
      OptimizeDrawCall.prototype.setHasChange = function() {};
      __decorate([ property({
        displayName: "\u5f00\u542f\u4f18\u5316",
        tooltip: "\u7528\u4e8e\u5bf9\u6bd4\u4f18\u5316\u6548\u679c"
      }) ], OptimizeDrawCall.prototype, "enabledOptimize", void 0);
      __decorate([ property() ], OptimizeDrawCall.prototype, "_options", void 0);
      __decorate([ property({
        type: OptimizeDrawCallOptions,
        displayName: "\u4f18\u5316\u9879",
        tooltip: "\u4e0d\u540c\u5c42\u7ea7"
      }) ], OptimizeDrawCall.prototype, "options", null);
      OptimizeDrawCall = __decorate([ ccclass, menu("\u4f18\u5316\u7ec4\u4ef6/DrawCall"), executionOrder(1) ], OptimizeDrawCall);
      return OptimizeDrawCall;
    }(cc.Component);
    exports.default = OptimizeDrawCall;
    cc._RF.pop();
  }, {} ],
  Particle: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "9d67asWHiZMGb0VgUYlilQX", "Particle");
    cc._RF.pop();
  }, {} ],
  PrefabPool: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "68b9abgZn9BTIZSWW5ZmiZH", "PrefabPool");
    "use strict";
    var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
      return new (P || (P = Promise))(function(resolve, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve(result.value) : new P(function(resolve) {
            resolve(result.value);
          }).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    var __generator = this && this.__generator || function(thisArg, body) {
      var _ = {
        label: 0,
        sent: function() {
          if (1 & t[0]) throw t[1];
          return t[1];
        },
        trys: [],
        ops: []
      }, f, y, t, g;
      return g = {
        next: verb(0),
        throw: verb(1),
        return: verb(2)
      }, "function" === typeof Symbol && (g[Symbol.iterator] = function() {
        return this;
      }), g;
      function verb(n) {
        return function(v) {
          return step([ n, v ]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
          if (f = 1, y && (t = 2 & op[0] ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 
          0) : y.next) && !(t = t.call(y, op[1])).done) return t;
          (y = 0, t) && (op = [ 2 & op[0], t.value ]);
          switch (op[0]) {
           case 0:
           case 1:
            t = op;
            break;

           case 4:
            _.label++;
            return {
              value: op[1],
              done: false
            };

           case 5:
            _.label++;
            y = op[1];
            op = [ 0 ];
            continue;

           case 7:
            op = _.ops.pop();
            _.trys.pop();
            continue;

           default:
            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (6 === op[0] || 2 === op[0])) {
              _ = 0;
              continue;
            }
            if (3 === op[0] && (!t || op[1] > t[0] && op[1] < t[3])) {
              _.label = op[1];
              break;
            }
            if (6 === op[0] && _.label < t[1]) {
              _.label = t[1];
              t = op;
              break;
            }
            if (t && _.label < t[2]) {
              _.label = t[2];
              _.ops.push(op);
              break;
            }
            t[2] && _.ops.pop();
            _.trys.pop();
            continue;
          }
          op = body.call(thisArg, _);
        } catch (e) {
          op = [ 6, e ];
          y = 0;
        } finally {
          f = t = 0;
        }
        if (5 & op[0]) throw op[1];
        return {
          value: op[0] ? op[1] : void 0,
          done: true
        };
      }
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ResourceLoader_1 = require("./ResourceLoader");
    var FreeType;
    (function(FreeType) {
      FreeType[FreeType["opacity"] = 0] = "opacity";
      FreeType[FreeType["remove"] = 1] = "remove";
    })(FreeType = exports.FreeType || (exports.FreeType = {}));
    var PrefabPool = function() {
      function PrefabPool(url, prefab) {
        this._createCount = 0;
        this._warterMark = 10;
        this._res = null;
        this._nodes = new Array();
        this._url = url;
        this._res = prefab;
      }
      PrefabPool.prototype.getUrl = function() {
        return this._url;
      };
      PrefabPool.prototype.getPrefab = function() {
        if (this._nodes.length > 0) {
          var prefab = this._nodes.pop();
          if (!prefab.isValid) return this.getPrefab();
          prefab.opacity = 255;
          return prefab;
        }
        this._createCount++;
        var res = this._res;
        return cc.instantiate(res);
      };
      PrefabPool.prototype.freePrefab = function(node, freeType) {
        void 0 === freeType && (freeType = FreeType.opacity);
        if (!(node && cc.isValid(node))) {
          cc.error("[ERROR] PrefabPool: freePrefab: isValid node");
          this._createCount--;
          return;
        }
        if (this._warterMark < this._nodes.length) {
          this._createCount--;
          node.destroy();
        } else {
          freeType == FreeType.remove ? node.removeFromParent() : freeType == FreeType.opacity && (node.opacity = 0);
          this._nodes.push(node);
        }
      };
      PrefabPool.prototype.setWaterMark = function(waterMakr) {
        this._warterMark = waterMakr;
      };
      PrefabPool.prototype.isUnuse = function() {
        this._nodes.length > this._createCount && cc.error("PrefabPool: _nodes.length > _createCount");
        return this._nodes.length == this._createCount;
      };
      PrefabPool.prototype.destory = function() {
        for (var _i = 0, _a = this._nodes; _i < _a.length; _i++) {
          var node = _a[_i];
          node.destroy();
        }
        this._createCount -= this._nodes.length;
        this._nodes.length = 0;
        ResourceLoader_1.default.getInstance().releaseRes(this._url, ResourceLoader_1.default.createUseKey("PrefabPool"));
      };
      return PrefabPool;
    }();
    exports.PrefabPool = PrefabPool;
    var CPrefabPoolMgr = function() {
      function CPrefabPoolMgr() {
        this._pools = new Map();
      }
      CPrefabPoolMgr.getInstance = function() {
        this._prefabPoolMgr || (this._prefabPoolMgr = new CPrefabPoolMgr());
        return this._prefabPoolMgr;
      };
      CPrefabPoolMgr.destroy = function() {
        this._prefabPoolMgr && (this._prefabPoolMgr = null);
      };
      CPrefabPoolMgr.prototype.initPrefabPool = function(url, finishCallback, warterMark) {
        var _this = this;
        void 0 === finishCallback && (finishCallback = null);
        void 0 === warterMark && (warterMark = 64);
        if (this.hasPool(url)) {
          finishCallback && finishCallback(null, this._pools.get(url));
          return;
        }
        finishCallback || this._pools.set(url, null);
        ResourceLoader_1.default.getInstance().loadRes(url, cc.Prefab, function(error, res) {
          var pool = null;
          if (error) _this._pools.delete(url); else {
            pool = new PrefabPool(url, res);
            pool.setWaterMark(warterMark);
            _this._pools.set(url, pool);
          }
          finishCallback && finishCallback(error, pool);
        }, ResourceLoader_1.default.createUseKey("PrefabPool"));
      };
      CPrefabPoolMgr.prototype.getNode = function(url, complateCall) {
        void 0 === complateCall && (complateCall = null);
        if (PrefabPoolMgr.hasPool(url)) return PrefabPoolMgr.getPool(url).getPrefab();
        PrefabPoolMgr.initPrefabPool(url, complateCall);
        return null;
      };
      CPrefabPoolMgr.prototype.getNodeAsync = function(url) {
        return __awaiter(this, void 0, void 0, function() {
          var pool;
          return __generator(this, function(_a) {
            switch (_a.label) {
             case 0:
              if (!PrefabPoolMgr.hasPool(url)) return [ 3, 1 ];
              return [ 2, PrefabPoolMgr.getPool(url).getPrefab() ];

             case 1:
              return [ 4, PrefabPoolMgr.initPrefabPoolAsync(url) ];

             case 2:
              pool = _a.sent();
              return [ 2, pool.getPrefab() ];
            }
          });
        });
      };
      CPrefabPoolMgr.prototype.getPool = function(url) {
        return this._pools.get(url);
      };
      CPrefabPoolMgr.prototype.hasPool = function(url) {
        return this._pools.has(url) ? null != this._pools.get(url) : this._pools.has(url);
      };
      CPrefabPoolMgr.prototype.destroyPool = function(url) {
        if (this.hasPool(url)) {
          this._pools.get(url).destory();
          this._pools.delete(url);
        }
      };
      CPrefabPoolMgr.prototype.initPrefabPoolAsync = function(url, warterMark) {
        void 0 === warterMark && (warterMark = 32);
        return __awaiter(this, void 0, Promise, function() {
          var _this = this;
          return __generator(this, function(_a) {
            return [ 2, new Promise(function(resolve, reject) {
              _this.hasPool(url) ? resolve(_this._pools.get(url)) : ResourceLoader_1.default.getInstance().loadRes(url, cc.Prefab, function(error, res) {
                var pool = null;
                if (error) reject(error); else {
                  pool = new PrefabPool(url, res);
                  pool.setWaterMark(warterMark);
                  _this._pools.set(url, pool);
                  resolve(pool);
                }
              }, ResourceLoader_1.default.createUseKey("PrefabPool"));
            }) ];
          });
        });
      };
      CPrefabPoolMgr.prototype.initPoolByNode = function(url, copyNode, warterMark) {
        var _this = this;
        void 0 === warterMark && (warterMark = 32);
        return new Promise(function(resolve, reject) {
          if (_this.hasPool(url)) resolve(_this._pools.get(url)); else {
            var pool = null;
            pool = new PrefabPool(url, cc.instantiate(copyNode));
            pool.setWaterMark(warterMark);
            _this._pools.set(url, pool);
            resolve(pool);
          }
        });
      };
      CPrefabPoolMgr._prefabPoolMgr = null;
      return CPrefabPoolMgr;
    }();
    var PrefabPoolMgr = CPrefabPoolMgr.getInstance();
    exports.PrefabPoolMgr = PrefabPoolMgr;
    cc._RF.pop();
  }, {
    "./ResourceLoader": "ResourceLoader"
  } ],
  ProtoBuf: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7cb7byhvtdFA7SNm4kMiXZY", "ProtoBuf");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ResourceLoader_1 = require("../resource/ResourceLoader");
    var ProtoBuf = function() {
      function ProtoBuf() {
        this.protobufjs = require("protobufjs");
        var self = this;
        this.protobufjs.loadProtoFile = function(filename, callback, builder) {
          callback && "object" === typeof callback ? (builder = callback, callback = null) : callback && "function" === typeof callback || (callback = null);
          if (callback) return ResourceLoader_1.default.getInstance().loadRes("string" === typeof filename ? filename : filename["root"] + "/" + filename["file"], function(error, contents) {
            if (null === contents) {
              callback(Error("Failed to fetch file"));
              return;
            }
            try {
              callback(error, self.protobufjs.loadProto(contents, builder, filename));
            } catch (e) {
              callback(e);
            }
          });
          var contents = ResourceLoader_1.default.getInstance().loadRes("object" === typeof filename ? filename["root"] + "/" + filename["file"] : filename);
          return null === contents ? null : self.protobufjs.loadProto(contents, builder, filename);
        };
        this.protobufjs.Util.fetch = cc.loader.getRes.bind(cc.loader);
      }
      ProtoBuf.prototype.loadFile = function(filePath, doFunc) {
        var newBuilder = this.protobufjs.newBuilder();
        this.protobufjs.loadProtoFile(filePath, function(error, builder) {
          if (error) {
            console.error("ProtoBuf loadFile error, msg = " + error);
            doFunc(null, error);
            return;
          }
          cc.log("loadFile " + filePath + " success!");
          "function" == typeof doFunc && doFunc(builder, null);
        }, newBuilder);
      };
      return ProtoBuf;
    }();
    exports.default = ProtoBuf;
    cc._RF.pop();
  }, {
    "../resource/ResourceLoader": "ResourceLoader",
    protobufjs: 5
  } ],
  ProtoLoader: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2a998r4HWlHrpbntCuziIv9", "ProtoLoader");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ProtoBuf_1 = require("./ProtoBuf");
    var Message_1 = require("./Message");
    var ProtoMessage_1 = require("../../../ProtoMessage");
    var PROTO_PATH = "proto/";
    var BASE_FILE = "base";
    var ProtoLoader = function() {
      function ProtoLoader() {
        this.protoBuf = null;
        this.loadedFileCount = 0;
        this.protoBuf = new ProtoBuf_1.default();
      }
      ProtoLoader.prototype.load = function(finishCb) {
        this._finishCb = finishCb;
        this.registerBaseFile();
      };
      ProtoLoader.prototype.registerBaseFile = function() {
        var _this = this;
        var basePath = PROTO_PATH + BASE_FILE;
        this.protoBuf.loadFile(basePath, function(builder, error) {
          _this.registerMsg([ builder ]);
          _this.registerAllProtoFile();
        });
      };
      ProtoLoader.prototype.registerAllProtoFile = function() {
        var _this = this;
        this.loadedFileCount = 0;
        var builders = [];
        for (var i = 0; i < ProtoMessage_1.ProtoFile.length; i++) {
          if (ProtoMessage_1.ProtoFile[i] == BASE_FILE) {
            this.loadedFileCount++;
            continue;
          }
          var path = PROTO_PATH + ProtoMessage_1.ProtoFile[i];
          this.protoBuf.loadFile(path, function(builder, error) {
            builder && builders.push(builder);
            _this.loadedFileCount++;
            if (_this.loadedFileCount >= ProtoMessage_1.ProtoFile.length) {
              _this.registerMsg(builders);
              _this._finishCb && _this._finishCb();
            }
          });
        }
      };
      ProtoLoader.prototype.registerMsg = function(builders) {
        builders.forEach(function(b) {
          var pbObj = b.build("");
          Message_1.MessageRegister.registerMsg(pbObj);
        });
      };
      return ProtoLoader;
    }();
    exports.default = new ProtoLoader();
    cc._RF.pop();
  }, {
    "../../../ProtoMessage": "ProtoMessage",
    "./Message": "Message",
    "./ProtoBuf": "ProtoBuf"
  } ],
  ProtoMessage: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "8f94dDRN2FAsJZ5Z0LlSIsU", "ProtoMessage");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var Message_1 = require("./commonLib/main/network/Message");
    exports.ProtoFile = [ "base", "login" ];
    var NUMBER_ARRAYS = function(_super) {
      __extends(NUMBER_ARRAYS, _super);
      function NUMBER_ARRAYS(databuff) {
        void 0 === databuff && (databuff = null);
        var _this = _super.call(this) || this;
        _this.protocolType = -1;
        _this.messageName = "NUMBER_ARRAYS";
        _this.initMsgObj(databuff);
        return _this;
      }
      Object.defineProperty(NUMBER_ARRAYS.prototype, "numbers", {
        get: function() {
          return this.msgObj.numbers;
        },
        set: function(param) {
          this.msgObj.numbers = param;
        },
        enumerable: true,
        configurable: true
      });
      return NUMBER_ARRAYS;
    }(Message_1.CMessageBase);
    exports.NUMBER_ARRAYS = NUMBER_ARRAYS;
    Message_1.MessageRegister.registerClass(-1, NUMBER_ARRAYS);
    var C2G_Login = function(_super) {
      __extends(C2G_Login, _super);
      function C2G_Login(databuff) {
        void 0 === databuff && (databuff = null);
        var _this = _super.call(this) || this;
        _this.protocolType = 1e4;
        _this.messageName = "C2G_Login";
        _this.initMsgObj(databuff);
        return _this;
      }
      Object.defineProperty(C2G_Login.prototype, "cmd", {
        get: function() {
          return this.msgObj.cmd;
        },
        set: function(param) {
          this.msgObj.cmd = param;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(C2G_Login.prototype, "name", {
        get: function() {
          return this.msgObj.name;
        },
        set: function(param) {
          this.msgObj.name = param;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(C2G_Login.prototype, "pw", {
        get: function() {
          return this.msgObj.pw;
        },
        set: function(param) {
          this.msgObj.pw = param;
        },
        enumerable: true,
        configurable: true
      });
      return C2G_Login;
    }(Message_1.CMessageBase);
    exports.C2G_Login = C2G_Login;
    Message_1.MessageRegister.registerClass(1e4, C2G_Login);
    var G2C_Login = function(_super) {
      __extends(G2C_Login, _super);
      function G2C_Login(databuff) {
        void 0 === databuff && (databuff = null);
        var _this = _super.call(this) || this;
        _this.protocolType = 10001;
        _this.messageName = "G2C_Login";
        _this.initMsgObj(databuff);
        return _this;
      }
      Object.defineProperty(G2C_Login.prototype, "msg", {
        get: function() {
          return this.msgObj.msg;
        },
        set: function(param) {
          this.msgObj.msg = param;
        },
        enumerable: true,
        configurable: true
      });
      return G2C_Login;
    }(Message_1.CMessageBase);
    exports.G2C_Login = G2C_Login;
    Message_1.MessageRegister.registerClass(10001, G2C_Login);
    var C2G_Heat_beat = function(_super) {
      __extends(C2G_Heat_beat, _super);
      function C2G_Heat_beat(databuff) {
        void 0 === databuff && (databuff = null);
        var _this = _super.call(this) || this;
        _this.protocolType = 10003;
        _this.messageName = "C2G_Heat_beat";
        _this.initMsgObj(databuff);
        return _this;
      }
      Object.defineProperty(C2G_Heat_beat.prototype, "msg", {
        get: function() {
          return this.msgObj.msg;
        },
        set: function(param) {
          this.msgObj.msg = param;
        },
        enumerable: true,
        configurable: true
      });
      return C2G_Heat_beat;
    }(Message_1.CMessageBase);
    exports.C2G_Heat_beat = C2G_Heat_beat;
    Message_1.MessageRegister.registerClass(10003, C2G_Heat_beat);
    var G2C_Heat_beat = function(_super) {
      __extends(G2C_Heat_beat, _super);
      function G2C_Heat_beat(databuff) {
        void 0 === databuff && (databuff = null);
        var _this = _super.call(this) || this;
        _this.protocolType = 10004;
        _this.messageName = "G2C_Heat_beat";
        _this.initMsgObj(databuff);
        return _this;
      }
      Object.defineProperty(G2C_Heat_beat.prototype, "msg", {
        get: function() {
          return this.msgObj.msg;
        },
        set: function(param) {
          this.msgObj.msg = param;
        },
        enumerable: true,
        configurable: true
      });
      return G2C_Heat_beat;
    }(Message_1.CMessageBase);
    exports.G2C_Heat_beat = G2C_Heat_beat;
    Message_1.MessageRegister.registerClass(10004, G2C_Heat_beat);
    cc._RF.pop();
  }, {
    "./commonLib/main/network/Message": "Message"
  } ],
  RankItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "289dfhrBExHXamcTOe7S09Z", "RankItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_rankItem_1 = require("./auto_rankItem");
    var ListItem_1 = require("../../../commonLib/main/ui/List/ListItem");
    var StringFormat_1 = require("../../../commonLib/main/modelView/StringFormat");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var RankItem = function(_super) {
      __extends(RankItem, _super);
      function RankItem() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        _this.data = null;
        return _this;
      }
      RankItem.prototype.refreshItem = function(data) {
        this.ui || (this.ui = this.node.addComponent(auto_rankItem_1.default));
        this.data = data;
      };
      RankItem.prototype.initData = function(data, rank) {
        this.ui || (this.ui = this.node.addComponent(auto_rankItem_1.default));
        this.data = data;
        var account = data.account;
        this.ui.lblScore.string = rank;
        var uiSwitch = this.ui.sprAchivIcon.getComponent("ui_switcher");
        rank >= 1 && rank <= 3 ? uiSwitch.changeStateByName("state" + rank) : uiSwitch.changeStateByName("state4");
        this.ui.lblName.string = account.name ? account.name : "\u73a9\u5bb6" + (account.playerIndex >= 0 ? account.playerIndex : "??");
        this.ui.lblStage.string = account.task ? account.task.maxStage : 0;
        this.ui.lblTime.string = StringFormat_1.StringFormatFunction.time_d_zh2(account.playTotalTime ? account.playTotalTime : 0);
      };
      RankItem.prototype.refreshRank = function(rank) {
        this.ui || (this.ui = this.node.addComponent(auto_rankItem_1.default));
        this.ui.lblScore.string = rank;
        var uiSwitch = this.ui.sprAchivIcon.getComponent("ui_switcher");
        rank >= 1 && rank <= 3 ? uiSwitch.changeStateByName("state" + rank) : uiSwitch.changeStateByName("state4");
      };
      RankItem = __decorate([ ccclass ], RankItem);
      return RankItem;
    }(ListItem_1.default);
    exports.default = RankItem;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/modelView/StringFormat": "StringFormat",
    "../../../commonLib/main/ui/List/ListItem": "ListItem",
    "./auto_rankItem": "auto_rankItem"
  } ],
  ResourceLoader: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "75f82g6y+lIRJPaA7YB+5LP", "ResourceLoader");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var SceneUtil_1 = require("./SceneUtil");
    var Log_1 = require("../utils/Log");
    exports.ResUse = {
      UI: "UI"
    };
    var isChildClassOf = cc.js["isChildClassOf"];
    isChildClassOf || (isChildClassOf = cc["isChildClassOf"]);
    var ResourceLoader = function() {
      function ResourceLoader() {
        this._resMap = new Map();
        this._loadingResMap = new Map();
        this._loadedSceneRecord = [];
      }
      ResourceLoader.getInstance = function() {
        this._instance || (this._instance = new ResourceLoader());
        return this._instance;
      };
      ResourceLoader.createUseKey = function(where, who, why) {
        void 0 === who && (who = "none");
        void 0 === why && (why = "");
        return "use_" + where + "_by_" + who + "_for" + why;
      };
      ResourceLoader.prototype.getCacheInfo = function(key) {
        this._resMap.has(key) || this._resMap.set(key, {
          refs: new Set(),
          uses: new Set()
        });
        return this._resMap.get(key);
      };
      ResourceLoader.prototype._getResItem = function(url, type) {
        var ccloader = cc.loader;
        var item = ccloader._cache[url];
        if (!item) {
          var uuid = ccloader._getResUuid(url, type, false);
          if (uuid) {
            var refKey = ccloader._getReferenceKey(uuid);
            item = ccloader._cache[refKey];
          }
        }
        return item;
      };
      ResourceLoader.prototype._dealLoadResArgs = function() {
        if (arguments.length < 1 || "string" != typeof arguments[0]) {
          console.error("_dealLoadResArgs error " + arguments);
          return;
        }
        var ret = {
          url: arguments[0]
        };
        for (var i = 1; i < arguments.length; ++i) 1 == i && isChildClassOf(arguments[i], cc.RawAsset) ? ret.type = arguments[i] : i == arguments.length - 1 && "string" == typeof arguments[i] ? ret.use = arguments[i] : "function" == typeof arguments[i] && (arguments.length > i + 1 && "function" == typeof arguments[i + 1] ? ret.onProgress = arguments[i] : ret.onCompleted = arguments[i]);
        return ret;
      };
      ResourceLoader.prototype._dealReleaseResArgs = function() {
        if (arguments.length < 1 || "string" != typeof arguments[0]) {
          console.error("_dealReleaseResArgs error " + arguments);
          return null;
        }
        var ret = {
          url: arguments[0]
        };
        for (var i = 1; i < arguments.length; ++i) "string" == typeof arguments[i] ? ret.use = arguments[i] : ret.type = arguments[i];
        return ret;
      };
      ResourceLoader.prototype.loadRes = function() {
        var _this = this;
        var args = this._dealLoadResArgs.apply(this, arguments);
        if (this._loadingResMap.has(args.url)) {
          this._loadingResMap.get(args.url).push({
            onCompleted: args.onCompleted,
            use: args.use
          });
          return;
        }
        this._loadingResMap.set(args.url, [ {
          onCompleted: args.onCompleted,
          use: args.use
        } ]);
        Log_1.LOG_TAG.LOAD.isOpen && console.time("LoadRes|" + args.url);
        var finishCallback = function(error, resource) {
          if (error) {
            console.error("ResourceLoader.loadRes " + args.url + " failed! error = " + error.errorMessage);
            if (args.use == exports.ResUse.UI) {
              _this._loadingResMap.delete(args.url);
              args.onCompleted && args.onCompleted(error, null);
            }
            return;
          }
          var addDependKey = function(item, refKey) {
            if (item && item.dependKeys && Array.isArray(item.dependKeys)) for (var _i = 0, _a = item.dependKeys; _i < _a.length; _i++) {
              var depKey = _a[_i];
              _this.getCacheInfo(depKey).refs.add(refKey);
              var ccloader = cc.loader;
              var depItem = ccloader._cache[depKey];
              addDependKey(depItem, refKey);
            }
          };
          var item = _this._getResItem(args.url, args.type);
          item && item.id ? addDependKey(item, item.id) : cc.warn("addDependKey item error! for " + args.url);
          item && _this.getCacheInfo(item.id).refs.add(item.id);
          var completeList = _this._loadingResMap.get(args.url);
          for (var i = 0; i < completeList.length; i++) {
            var info = completeList[i];
            item && info.use && _this.getCacheInfo(item.id).uses.add(info.use);
            info.onCompleted && info.onCompleted(error, resource);
          }
          _this._loadingResMap.delete(args.url);
          Log_1.LOG_TAG.LOAD.isOpen && console.timeEnd("LoadRes|" + args.url);
        };
        var res = cc.loader.getRes(args.url, args.type);
        res ? finishCallback(null, res) : cc.loader.loadRes(args.url, args.type, args.onProgress, finishCallback);
      };
      ResourceLoader.prototype.releaseRes = function() {
        var args = this._dealReleaseResArgs.apply(this, arguments);
        var item = this._getResItem(args.url, args.type);
        if (!item) {
          console.warn("releaseRes item is null " + args.url);
          return;
        }
        Log_1.Log.log(Log_1.LOG_TAG.TEST, "resource loader release item", item.id);
        var cacheInfo = this.getCacheInfo(item.id);
        args.use && cacheInfo.uses.delete(args.use);
        this._release(item, item.id);
      };
      ResourceLoader.prototype._release = function(item, key) {
        var _this = this;
        if (!item) return;
        var cacheInfo = this.getCacheInfo(item.id);
        var delDependKey = function(item, refKey) {
          if (item && item.dependKeys && Array.isArray(item.dependKeys)) for (var _i = 0, _a = item.dependKeys; _i < _a.length; _i++) {
            var depKey = _a[_i];
            var ccloader = cc.loader;
            var depItem = ccloader._cache[depKey];
            depItem && _this._release(depItem, refKey);
          }
        };
        if (1 == cacheInfo.refs.size && cacheInfo.uses.size > 0) ; else {
          cacheInfo.refs.delete(key);
          delDependKey(item, key);
        }
        if (0 == cacheInfo.uses.size && 0 == cacheInfo.refs.size) {
          item.uuid ? cc.loader.release(item.uuid) : cc.loader.release(item.id);
          this._resMap.delete(item.id);
        }
      };
      ResourceLoader.prototype.checkReleaseUse = function() {
        var args = this._dealReleaseResArgs.apply(this, arguments);
        var item = this._getResItem(args.url, args.type);
        if (!item) {
          console.warn("check res can release, item is null " + args.url + " " + args.type);
          return;
        }
        var cacheInfo = this.getCacheInfo(item.id);
        var checkUse = false;
        var checkRef = false;
        checkUse = !(args.use && cacheInfo.uses.size > 0) || !(1 != cacheInfo.uses.size || !cacheInfo.uses.has(args.use));
        checkRef = !!(1 == cacheInfo.refs.size && cacheInfo.refs.has(item.id) || 0 == cacheInfo.refs.size);
        return checkUse && checkRef;
      };
      ResourceLoader.prototype.printInfo = function(key) {
        Log_1.Log.log(Log_1.LOG_TAG.TEST, " ---------------- ResourceLoader ---------------- ");
        if (key && 0 != key.length) {
          var map_1 = new Map();
          "string" === typeof key && (key = [ key ]);
          this._resMap.forEach(function(value, id) {
            var _loop_1 = function(i) {
              -1 != id.indexOf(key[i]) && map_1.set(id, value);
              value.uses.forEach(function(use) {
                if (-1 != use.indexOf(key[i])) {
                  map_1.set(id, value);
                  return;
                }
              });
              value.refs.forEach(function(ref) {
                if (-1 != ref.indexOf(key[i])) {
                  map_1.set(id, value);
                  return;
                }
              });
            };
            for (var i = 0; i < key.length; i++) _loop_1(i);
          });
          Log_1.Log.log(Log_1.LOG_TAG.TEST, map_1);
        } else Log_1.Log.log(Log_1.LOG_TAG.TEST, this._resMap);
        Log_1.Log.log(Log_1.LOG_TAG.TEST, " ------------------------------------------------ ");
      };
      ResourceLoader.prototype.initSceneResDeps = function(asset) {
        var _this = this;
        var addDependKey = function(item, refKey) {
          if (item && void 0 != item && "" != item && item.dependKeys && Array.isArray(item.dependKeys)) for (var _i = 0, _a = item.dependKeys; _i < _a.length; _i++) {
            var depKey = _a[_i];
            _this.getCacheInfo(depKey).refs.add(refKey);
            var ccloader = cc.loader;
            var depItem = ccloader._cache[depKey];
            addDependKey(depItem, refKey);
          }
        };
        if (asset) {
          var uuid = asset["_uuid"];
          SceneUtil_1.SceneUuidMap.set(asset.name, uuid);
          if (-1 != this._loadedSceneRecord.indexOf(uuid)) return;
          this._loadedSceneRecord.push(uuid);
          var useKey = ResourceLoader.createUseKey("Scene_" + asset.name);
          var ccloader = cc.loader;
          var refKey = ccloader._getReferenceKey(uuid);
          var item = ccloader._cache[refKey];
          asset.scene.autoReleaseAssets && console.error("\u5f53\u524d\u573a\u666f" + asset.name + "\u4e0d\u80fd\u8bbe\u7f6e\u4e3a\u81ea\u52a8\u91ca\u653e\u8d44\u6e90");
          Log_1.Log.log(Log_1.LOG_TAG.TEST, "\u4e3a\u9884\u52a0\u8f7d\u573a\u666f" + asset.name + "\u5efa\u7acb\u5176\u6240\u4f9d\u8d56\u7684\u8d44\u6e90\u5f15\u7528\u5173\u7cfb");
          addDependKey(item, uuid);
          for (var i = 0; i < item.dependKeys.length; i++) {
            var depItem = this._getResItem(item.dependKeys[i]);
            this.getCacheInfo(depItem.id).uses.add(useKey);
          }
        } else {
          var scene = cc.director.getScene();
          var dependAssets = scene["dependAssets"];
          SceneUtil_1.SceneUuidMap.set(scene.name, scene.uuid);
          if (-1 != this._loadedSceneRecord.indexOf(scene.uuid)) return;
          this._loadedSceneRecord.push(scene.uuid);
          scene.autoReleaseAssets && console.error("\u5f53\u524d\u573a\u666f" + scene.name + "\u4e0d\u80fd\u8bbe\u7f6e\u4e3a\u81ea\u52a8\u91ca\u653e\u8d44\u6e90");
          Log_1.Log.log(Log_1.LOG_TAG.TEST, "\u4e3a\u573a\u666f" + scene.name + "\u5efa\u7acb\u5176\u6240\u4f9d\u8d56\u7684\u8d44\u6e90\u5f15\u7528\u5173\u7cfb");
          var useKey = ResourceLoader.createUseKey("Scene_" + scene.name);
          for (var i = 0; i < dependAssets.length; i++) {
            var item = this._getResItem(dependAssets[i]);
            if (item) {
              var info = this.getCacheInfo(item.id);
              if (!info.refs.has(scene.uuid)) {
                this.getCacheInfo(item.id).refs.add(scene.uuid);
                this.getCacheInfo(item.id).uses.add(useKey);
                addDependKey(item, scene.uuid);
              }
            }
          }
        }
      };
      ResourceLoader.prototype.releaseSceneResDeps = function(sceneName) {
        var _this = this;
        Log_1.Log.log(Log_1.LOG_TAG.TEST, "\u91ca\u653e\u573a\u666f" + sceneName + "\u6240\u4f9d\u8d56\u7684\u8d44\u6e90");
        var useKey = ResourceLoader.createUseKey("Scene_" + sceneName);
        var uuid = SceneUtil_1.SceneUuidMap.get(sceneName);
        var index = this._loadedSceneRecord.indexOf(uuid);
        this._loadedSceneRecord.splice(index, 1);
        var release = function(item, refKey) {
          var cacheInfo = _this.getCacheInfo(item.id);
          cacheInfo.refs.delete(refKey);
          var delDependKey = function(item, refKey) {
            if (item && item.dependKeys && Array.isArray(item.dependKeys)) for (var _i = 0, _a = item.dependKeys; _i < _a.length; _i++) {
              var depKey = _a[_i];
              var ccloader = cc.loader;
              var depItem = ccloader._cache[depKey];
              depItem && release(depItem, refKey);
            }
          };
          delDependKey(item, refKey);
          if (0 == cacheInfo.uses.size && 0 == cacheInfo.refs.size) {
            item.uuid ? cc.loader.release(item.uuid) : cc.loader.release(item.id);
            _this._resMap.delete(item.id);
          }
        };
        this._resMap.forEach(function(value, key) {
          if (value.uses.has(useKey)) {
            var item = _this._getResItem(key);
            value.uses.delete(useKey);
            release(item, uuid);
          }
        });
      };
      ResourceLoader._instance = null;
      ResourceLoader.ResourceIndex = 0;
      return ResourceLoader;
    }();
    exports.default = ResourceLoader;
    exports.Loader = ResourceLoader.getInstance();
    cc._RF.pop();
  }, {
    "../utils/Log": "Log",
    "./SceneUtil": "SceneUtil"
  } ],
  SceneLoadingTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f168afK06lEIJbo5LIzRsMf", "SceneLoadingTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMParent_1 = require("../../../commonLib/main/modelView/VMParent");
    var auto_SceneLoadingTip_1 = require("../../../data/autoui/LoadingTip/auto_SceneLoadingTip");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var SceneLoadingTip = function(_super) {
      __extends(SceneLoadingTip, _super);
      function SceneLoadingTip() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        _this.isClickThrough = true;
        _this.showOpenAnima = false;
        return _this;
      }
      SceneLoadingTip.prototype.onBind = function() {
        this.data = {
          progress: 0
        };
        this.ui = this.node.addComponent(auto_SceneLoadingTip_1.default);
      };
      SceneLoadingTip.prototype.setProgress = function(value) {
        this.data.progress = value;
      };
      SceneLoadingTip.prefabUrl = "ssets/commonPrefab/LoadingTip/SceneLoadingTip";
      SceneLoadingTip.className = "SceneLoadingTip";
      SceneLoadingTip = __decorate([ ccclass ], SceneLoadingTip);
      return SceneLoadingTip;
    }(VMParent_1.default);
    exports.default = SceneLoadingTip;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/modelView/VMParent": "VMParent",
    "../../../data/autoui/LoadingTip/auto_SceneLoadingTip": "auto_SceneLoadingTip"
  } ],
  SceneUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ecd8bg12rBMNKzddqEe+xKO", "SceneUtil");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ResourceLoader_1 = require("./ResourceLoader");
    exports.SceneUuidMap = new Map();
    var SceneUtil = function() {
      function SceneUtil() {}
      SceneUtil.isScene = function(sceneName) {
        return SceneUtil.getSceneName() == sceneName;
      };
      SceneUtil.getSceneName = function() {
        return cc.director.getScene().name;
      };
      SceneUtil.getLastSceneName = function() {
        if (!SceneUtil.lastSceneName) return SceneUtil.getSceneName();
        return SceneUtil.lastSceneName;
      };
      SceneUtil.preloadScene = function(sceneName, onProgress, onLoaded) {
        cc.director.preloadScene(sceneName, onProgress, function(error, asset) {
          error || ResourceLoader_1.default.getInstance().initSceneResDeps(asset);
          onLoaded && onLoaded(error, asset);
        });
      };
      SceneUtil.switchScene = function(sceneName, onLaunched) {
        SceneUtil.lastSceneName = cc.director.getScene().name;
        cc.director.loadScene(sceneName, function(err, scene) {
          onLaunched && onLaunched(err, scene);
          ResourceLoader_1.default.getInstance().initSceneResDeps();
          ResourceLoader_1.default.getInstance().releaseSceneResDeps(SceneUtil.lastSceneName);
        });
      };
      return SceneUtil;
    }();
    exports.default = SceneUtil;
    cc._RF.pop();
  }, {
    "./ResourceLoader": "ResourceLoader"
  } ],
  ScheduleMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "5f454e/HuNCm6mMXeCDF6yB", "ScheduleMng");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ScheduleMng = function(_super) {
      __extends(ScheduleMng, _super);
      function ScheduleMng() {
        var _this = _super.call(this) || this;
        _this.schedules = {};
        false;
        return _this;
      }
      ScheduleMng.prototype.addSchedule = function(tag, callback, interval, target, repeat, delay) {
        var scheduler = cc.director.getScheduler();
        scheduler.enableForTarget(target || this);
        this.removeSchedule(tag);
        var component = target || this;
        scheduler.schedule(callback, component, interval, repeat, delay);
        this.schedules[tag] = {
          target: component,
          callback: callback
        };
      };
      ScheduleMng.prototype.removeSchedule = function(tag) {
        var scheduler = cc.director.getScheduler();
        var lastSchedule = this.schedules[tag];
        if (lastSchedule && lastSchedule.target) {
          scheduler.unschedule(lastSchedule.callback, lastSchedule.target);
          lastSchedule.target = null;
          lastSchedule.callback = null;
        }
      };
      ScheduleMng.prototype.clear = function() {
        this.unscheduleAllCallbacks();
      };
      ScheduleMng.prototype.addScheduleOnce = function(callback, interval, tag) {
        var scheduler = cc.director.getScheduler();
        scheduler.enableForTarget(this);
        tag && this.removeSchedule(tag);
        var component = this;
        component.schedule(callback, interval, 0, 0);
        tag && (this.schedules[tag] = {
          target: component,
          callback: callback
        });
      };
      return ScheduleMng;
    }(cc.Component);
    exports.default = new ScheduleMng();
    cc._RF.pop();
  }, {} ],
  SingletonFactory: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "9397cX/vA9FY40I/muXYjSY", "SingletonFactory");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var SingletonFactory = function() {
      function SingletonFactory() {}
      SingletonFactory.getInstance = function(c) {
        if (!SingletonFactory.instances.has(c)) {
          var obj = new c();
          SingletonFactory.instances.set(c, obj);
          return obj;
        }
        return SingletonFactory.instances.get(c);
      };
      SingletonFactory.removeInstance = function(c) {
        SingletonFactory.instances.has(c) && SingletonFactory.instances.delete(c);
      };
      SingletonFactory.clear = function() {
        SingletonFactory.instances = new Map();
      };
      SingletonFactory.instances = new Map();
      return SingletonFactory;
    }();
    exports.SingletonFactory = SingletonFactory;
    cc._RF.pop();
  }, {} ],
  Socket: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "c20a1Ci14BNQqiBlUOgC0Sl", "Socket");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var Log_1 = require("../utils/Log");
    var SocketState;
    (function(SocketState) {
      SocketState[SocketState["CONNECTING"] = 1] = "CONNECTING";
      SocketState[SocketState["OPEN"] = 2] = "OPEN";
      SocketState[SocketState["CLOSING"] = 3] = "CLOSING";
      SocketState[SocketState["CLOSED"] = 4] = "CLOSED";
    })(SocketState = exports.SocketState || (exports.SocketState = {}));
    var WebSock = function() {
      function WebSock() {
        this._ws = null;
        this.onConnected = null;
        this.onMessage = null;
        this.onError = null;
        this.onClosed = null;
      }
      WebSock.prototype.connect = function(options) {
        var _this = this;
        if (this._ws && this._ws.readyState === WebSocket.CONNECTING) {
          Log_1.Log.log(Log_1.LOG_TAG.SOCKET, "websocket connecting, wait for a moment...");
          return false;
        }
        var url = null;
        if (options.url) url = options.url; else {
          var ip = options.ip;
          var port = options.port;
          var protocol = options.protocol;
          url = protocol + "://" + ip + ":" + port;
        }
        this._ws = new WebSocket(url);
        this._ws.binaryType = options.binaryType ? options.binaryType : "arraybuffer";
        this._ws.onmessage = function(event) {
          _this.onMessage(event.data);
        };
        this._ws.onopen = this.onConnected;
        this._ws.onerror = this.onError;
        this._ws.onclose = this.onClosed;
        return true;
      };
      WebSock.prototype.send = function(buffer) {
        if (this._ws.readyState == WebSocket.OPEN) {
          this._ws.send(buffer);
          return true;
        }
        return false;
      };
      WebSock.prototype.close = function(code, reason) {
        this._ws.close();
      };
      return WebSock;
    }();
    exports.WebSock = WebSock;
    cc._RF.pop();
  }, {
    "../utils/Log": "Log"
  } ],
  SpineUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "edcdb+LRedM4pVXbTb4gOAM", "SpineUtil");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property, executeInEditMode = _a.executeInEditMode, playOnFocus = _a.playOnFocus;
    var DefaultFramesEnum = cc.Enum({
      "<None>": 0
    });
    function setEnumAttr(obj, propName, enumDef) {
      cc.Class.Attr.setClassAttr(obj, propName, "type", "Enum");
      cc.Class.Attr.setClassAttr(obj, propName, "enumList", cc.Enum.getList(enumDef));
    }
    var SpineEvent = function() {
      function SpineEvent() {
        this.spineUtil = null;
        this.eventName = "";
        this.bone = "";
        this.events = [ new cc.Component.EventHandler() ];
      }
      SpineEvent.prototype.init = function(event, spineUtil) {
        this.spineUtil = spineUtil;
        this.eventName = event.name;
        var frameObj = spineUtil.getFrameObj();
        frameObj && frameObj[this.eventName] && (this.events = frameObj[this.eventName]);
      };
      SpineEvent.prototype.setValue = function(value) {
        if (!this.spineUtil) return;
        var frameObj = this.spineUtil.getFrameObj();
        if (frameObj) frameObj[this.eventName] != value && (frameObj[this.eventName] = value); else {
          var arma = this.spineUtil.eventMaps[this.spineUtil.bones.defaultSkin];
          arma || (arma = this.spineUtil.eventMaps[this.spineUtil.bones.defaultSkin] = {});
          var anima = arma[this.spineUtil.bones.defaultAnimation];
          anima || (anima = arma[this.spineUtil.bones.defaultAnimation] = {});
          anima[this.eventName] = value;
        }
      };
      __decorate([ property({
        readonly: true
      }) ], SpineEvent.prototype, "eventName", void 0);
      __decorate([ property({
        visible: function() {
          return this.bone;
        },
        readonly: true,
        tooltip: "\u9aa8\u9abc\u63d2\u69fd"
      }) ], SpineEvent.prototype, "bone", void 0);
      __decorate([ property({
        type: cc.Component.EventHandler,
        displayName: "Events",
        tooltip: "\u8981\u89e6\u53d1\u7684\u4e8b\u4ef6\uff0ccusData\u53ef\u4ee5\u5e26\u53c2\u6570 json\u683c\u5f0f"
      }) ], SpineEvent.prototype, "events", void 0);
      SpineEvent = __decorate([ ccclass("SpineEvent") ], SpineEvent);
      return SpineEvent;
    }();
    var isinit = false;
    var SpineUtil = function(_super) {
      __extends(SpineUtil, _super);
      function SpineUtil() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.bones = null;
        _this.animationState = null;
        _this._lastArmatureName = "";
        _this._lastAnimaName = "";
        _this.eventMaps = {};
        _this._frameIndex = 0;
        _this.events = [];
        _this._showCusEvents = false;
        _this._cusEvents = [];
        _this._updateEventEnum = false;
        _this.lateUpdate = false;
        _this._frameNow = 0;
        return _this;
      }
      Object.defineProperty(SpineUtil.prototype, "frameIndex", {
        get: function() {
          return this._frameIndex;
        },
        set: function(value) {
          this._frameIndex = value;
          if (value < 0) return;
          var event = this.events[value].frame;
          var cusEvents = [];
          if (event) {
            var dragonEvent = new SpineEvent();
            dragonEvent.init(event, this);
            cusEvents.push(dragonEvent);
          }
          this.cusEvents = cusEvents;
          this._showCusEvents = cusEvents.length > 0;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(SpineUtil.prototype, "cusEvents", {
        get: function() {
          return this._cusEvents;
        },
        set: function(value) {
          this._cusEvents = value;
          this._cusEvents.forEach(function(spineEvent) {
            spineEvent.setValue(spineEvent.events);
          });
        },
        enumerable: true,
        configurable: true
      });
      SpineUtil.prototype.onLoad = function() {};
      SpineUtil.prototype.start = function() {
        false;
        this.addEvent();
      };
      SpineUtil.prototype.addEvent = function() {
        var _this = this;
        if (!this.bones) return;
        this.bones.setEventListener(function(track, event) {
          var shoudDoEvents = _this.getFrameObj(event.data.name);
          if (shoudDoEvents) {
            shoudDoEvents = shoudDoEvents.filter(function(t) {
              return "" != t.handler;
            });
            cc.Component.EventHandler.emitEvents(shoudDoEvents, event);
          }
        });
      };
      SpineUtil.prototype.testEvent = function(event, cusData) {
        cc.log("time:" + event.time.toFixed(1) + "\u79d2------name:" + event.data.name + "------cusData:" + cusData);
      };
      SpineUtil.prototype.getFrameObj = function(name) {
        try {
          var frameObj;
          false;
          var frameObj = this.eventMaps[this.bones.defaultSkin][this.bones.animation][name];
          return frameObj;
        } catch (e) {
          return null;
        }
      };
      SpineUtil.prototype.getAttachedNode = function(boneName) {
        var attachUtil = this.bones.attachUtil;
        var nodes = attachUtil.getAttachedNodes(boneName);
        0 == nodes.length && (nodes = attachUtil.generateAttachedNodes(boneName));
        return nodes;
      };
      SpineUtil.prototype.play = function(animaName, loop, trackIndex) {
        void 0 === loop && (loop = true);
        void 0 === trackIndex && (trackIndex = 0);
        this.animationState = this.bones.setAnimation(trackIndex, animaName, loop);
        return this.animationState;
      };
      SpineUtil.prototype.playTrack = function(animaArr) {
        var _this = this;
        var firstAnima = animaArr[0];
        firstAnima.delay ? this.scheduleOnce(function() {
          _this._playTrack(animaArr);
        }, firstAnima.delay) : this._playTrack(animaArr);
      };
      SpineUtil.prototype._playTrack = function(animaArr) {
        var _this = this;
        var firstAnima = animaArr[0];
        this.play(firstAnima.name, firstAnima.loop);
        animaArr.forEach(function(anima, i) {
          i > 0 && _this.bones.addAnimation(0, anima.name, anima.loop, anima.delay);
        });
      };
      SpineUtil.prototype.pause = function() {
        this.animationState.timeScale = 0;
      };
      SpineUtil.prototype.resume = function() {
        this.animationState.timeScale = 1;
      };
      SpineUtil.prototype.stop = function() {
        this.bones.clearTracks();
        this.bones.setBonesToSetupPose();
        this.animationState = null;
      };
      SpineUtil.prototype.setTimeScale = function(num) {
        this.bones.timeScale = num;
      };
      SpineUtil.prototype.setAnimaScale = function(num) {
        this.animationState.timeScale = num;
      };
      SpineUtil.prototype.setAnimationTrack = function(start, end) {
        start > -1 && (this.animationState.animationStart = start);
        end > -1 && (this.animationState.animationEnd = end);
      };
      SpineUtil.prototype.setTrackCompleteListener = function(listener) {
        this.bones.setTrackCompleteListener(this.animationState, listener);
      };
      __decorate([ property(sp.Skeleton) ], SpineUtil.prototype, "bones", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], SpineUtil.prototype, "_lastArmatureName", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], SpineUtil.prototype, "_lastAnimaName", void 0);
      __decorate([ property({
        visible: false
      }) ], SpineUtil.prototype, "eventMaps", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], SpineUtil.prototype, "_frameIndex", void 0);
      __decorate([ property({
        type: DefaultFramesEnum,
        displayName: "\u5e27\u4e8b\u4ef6",
        visible: function() {
          return -1 != this._frameIndex;
        }
      }) ], SpineUtil.prototype, "frameIndex", null);
      __decorate([ property({
        editorOnly: true
      }) ], SpineUtil.prototype, "events", void 0);
      __decorate([ property({
        editorOnly: true
      }) ], SpineUtil.prototype, "_showCusEvents", void 0);
      __decorate([ property({
        type: SpineEvent,
        visible: function() {
          return this._showCusEvents;
        },
        readonly: true
      }) ], SpineUtil.prototype, "cusEvents", null);
      SpineUtil = __decorate([ ccclass, executeInEditMode, menu("Util/SpineUtil") ], SpineUtil);
      return SpineUtil;
    }(cc.Component);
    exports.default = SpineUtil;
    cc._RF.pop();
  }, {} ],
  StringFormat: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "85fe8Gc6h5Ava+JsdbBs8cR", "StringFormat");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var StringFormat = function() {
      function StringFormat() {}
      StringFormat.prototype.deal = function(value, format) {
        if ("" === format) return value;
        format = format.toLowerCase().trim();
        var match_func = format.match(/^[a-z|A-Z]+/gi);
        var match_num = format.match(/\d+$/gi);
        var func = "";
        var num;
        var res = "";
        match_func && (func = match_func[0]);
        match_num && (num = parseInt(match_num[0]));
        if ("number" == typeof value) switch (func) {
         case "int":
          res = this.int(value);
          break;

         case "fix":
          res = this.fix(value, num);
          break;

         case "kmbt":
          res = this.KMBT(value);
          break;

         case "per":
          res = this.per(value, num);
          break;

         case "sep":
          res = this.sep(value);
          break;

         case "timem":
          res = this.time_m(value);
          break;

         case "timeh":
          res = this.time_h(value);
          break;

         case "timedzh":
          res = this.time_d_zh(value);
          break;

         case "timemzh":
          res = this.time_m_zh(value);
          break;

         case "timestamp":
          res = this.timeStamp(value);
          break;

         case "timehmauto":
          res = this.tem_hmauto(value);
        } else if ("string" == typeof value) {
          switch (func) {
           case "limit":
            res = this.limit(value, num);
          }
          res = value;
        } else switch (func) {
         case "big":
          res = this.bigNum(value);
        }
        return res;
      };
      StringFormat.prototype.sep = function(value) {
        var num = Math.round(value).toString();
        return num.replace(new RegExp("(\\d)(?=(\\d{3})+$)", "ig"), "$1,");
      };
      StringFormat.prototype.tem_hmauto = function(value) {
        return value >= 3600 ? this.time_h2(value) : this.time_m(value);
      };
      StringFormat.prototype.time_m = function(value) {
        var obj = this.func_numberToTime(value);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        var second = obj.second.toString();
        obj.second < 10 && (second = "0" + second);
        return cc.js.formatStr("%s:%s", minute, second);
      };
      StringFormat.prototype.time_h = function(value) {
        var obj = this.func_numberToTime(value);
        var hour = obj.hour.toString();
        obj.hour < 10 && (hour = "0" + hour);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        var second = obj.second.toString();
        obj.second < 10 && (second = "0" + second);
        return cc.js.formatStr("%s:%s:%s", hour, minute, second);
      };
      StringFormat.prototype.time_d_zh = function(value) {
        var obj = this.func_numberToTime(value);
        var day = 0;
        if (obj.hour >= 24) {
          day = Math.floor(obj.hour / 24);
          obj.hour %= 24;
        }
        var hour = obj.hour.toString();
        obj.hour < 10 && (hour = "0" + hour);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        var second = obj.second.toString();
        obj.second < 10 && (second = "0" + second);
        return day > 0 ? day + "\u5929" + hour + "\u65f6" + minute + "\u5206" + second + "\u79d2" : obj.hour > 0 ? hour + "\u65f6" + minute + "\u5206" + second + "\u79d2" : obj.minute > 0 ? minute + "\u5206" + second + "\u79d2" : second + "\u79d2";
      };
      StringFormat.prototype.time_d_zh2 = function(value) {
        var obj = this.func_numberToTime(value);
        var day = 0;
        if (obj.hour >= 24) {
          day = Math.floor(obj.hour / 24);
          obj.hour %= 24;
        }
        var hour = obj.hour.toString();
        obj.hour < 10 && (hour = "0" + hour);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        return day > 0 ? day + "\u5929" + hour + "\u65f6" + minute + "\u5206" : hour + "\u65f6" + minute + "\u5206";
      };
      StringFormat.prototype.time_m_zh = function(value) {
        var obj = this.func_numberToTime(value);
        var minute = 60 * obj.hour + obj.minute;
        return minute > 0 ? minute + "\u5206" : obj.second + "\u79d2";
      };
      StringFormat.prototype.time_h2 = function(value) {
        var obj = this.func_numberToTime(value);
        var hour = obj.hour.toString();
        obj.hour < 10 && (hour = "0" + hour);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        var second = obj.second.toString();
        obj.second < 10 && (second = "0" + second);
        return cc.js.formatStr("%s:%s", hour, minute);
      };
      StringFormat.prototype.time_s = function(value) {};
      StringFormat.prototype.time_ms = function(value) {};
      StringFormat.prototype.timeNum = function(time, format) {
        void 0 === format && (format = "h:m:s");
        var obj = this.func_numberToTime(time);
        var day = obj.day.toString();
        var hour = obj.hour.toString();
        obj.hour < 10 && (hour = "0" + hour);
        var minute = obj.minute.toString();
        obj.minute < 10 && (minute = "0" + minute);
        var second = obj.second.toString();
        obj.second < 10 && (second = "0" + second);
        var text = format.replace(/D/g, day).replace(/h/g, hour).replace(/m/g, minute).replace(/s/g, second);
        return text;
      };
      StringFormat.prototype.timeStamp = function(time, format) {
        void 0 === format && (format = "Y-M-D h:m:s");
        var mydate = null;
        cc.js.isNumber(time) ? mydate = new Date(1e3 * time) : cc.js.isString(time) ? mydate = new Date(1e3 * parseInt(time)) : time instanceof Date && (mydate = time);
        if (mydate) {
          var Y = mydate.getFullYear();
          var M = mydate.getMonth() + 1;
          var D = mydate.getDate();
          var h = mydate.getHours() < 10 ? "0" + mydate.getHours() : mydate.getHours();
          var m = mydate.getMinutes() < 10 ? "0" + mydate.getMinutes() : mydate.getMinutes();
          var s = mydate.getSeconds() < 10 ? "0" + mydate.getSeconds() : mydate.getSeconds();
          var text = format.replace(/Y/g, Y.toString()).replace(/M/g, M.toString()).replace(/D/g, D.toString()).replace(/h/g, h.toString()).replace(/m/g, m.toString()).replace(/s/g, s.toString());
          return text;
        }
        return "";
      };
      StringFormat.prototype.per = function(value, fd) {
        return parseFloat((100 * value).toFixed(2));
      };
      StringFormat.prototype.int = function(value) {
        return Math.round(value);
      };
      StringFormat.prototype.fix = function(value, fd) {
        return value.toFixed(fd);
      };
      StringFormat.prototype.limit = function(value, count) {
        return value.substring(0, count);
      };
      StringFormat.prototype.KMBT = function(value, lang) {
        void 0 === lang && (lang = "en");
        var counts = [ 1e3, 1e6, 1e9, 1e12, 1e16 ];
        var units = [ "", "K", "M", "B", "T", "E" ];
        switch (lang) {
         case "zh":
          var counts_1 = [ 1e4, 1e8, 1e12, 1e16 ];
          var units_1 = [ "", "\u4e07", "\u4ebf", "\u5146", "\u4eac" ];
        }
        return this.compressUnit(value, counts, units, 1);
      };
      StringFormat.prototype.time = function(value) {};
      StringFormat.prototype.func_numberToTime = function(value) {
        var day = Math.floor(value / 86400);
        value -= 60 * day * 60 * 24;
        var hour = Math.floor(value / 3600);
        value -= 60 * hour * 60;
        var minute = Math.floor(value / 60);
        value -= 60 * minute;
        var second = value;
        return {
          day: day,
          hour: hour,
          minute: minute,
          second: second
        };
      };
      StringFormat.prototype.compressUnit = function(value, valueArr, unitArr, fixNum) {
        void 0 === fixNum && (fixNum = 2);
        var counts = valueArr;
        var units = unitArr;
        var res;
        var index;
        for (index = 0; index < counts.length; index++) {
          var e = counts[index];
          if (value < e) {
            res = index > 0 ? (value / counts[index - 1]).toFixed(fixNum) : value.toFixed(0);
            break;
          }
          index == counts.length - 1 && (res = (value / counts[index]).toFixed(fixNum));
        }
        return parseFloat(res) + units[index];
      };
      StringFormat.prototype.bigNum = function(value) {
        var units = [ "", "K", "M", "B", "T", "E" ];
        var units2 = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ];
        var index = Math.floor(value.unit / 3);
        var num = 0, unit = "";
        if (0 == index) {
          num = value.num * Math.pow(10, value.unit);
          num = Math.floor(num);
        } else if (index <= 5) {
          num = value.num * Math.pow(10, value.unit % 3);
          unit = units[index];
        } else {
          var index2 = Math.floor((value.unit - 18) / 26) + 1;
          if (index2 <= 3) {
            var unitsTxt = "";
            var charIndex = (value.unit - 18) % 26;
            for (var i = 0; i < index2; i++) unitsTxt += units2[charIndex];
            num = value.num;
            unit = unitsTxt;
          } else {
            var unitsTxt = units2[(value.unit - 18) % 26] + index2;
            num = value.num;
            unit = unitsTxt;
          }
        }
        var abs = Math.abs(num);
        num = abs >= 100 ? Math.floor(num) : abs >= 10 ? Math.floor(10 * num) / 10 : Math.floor(100 * num) / 100;
        return num.toString() + unit;
      };
      return StringFormat;
    }();
    exports.StringFormatFunction = new StringFormat();
    String.prototype.format = function() {
      var param = [];
      for (var _i = 0; _i < arguments.length; _i++) param[_i] = arguments[_i];
      var args = Array.prototype.slice.call(arguments);
      var txt = this;
      args.forEach(function(arg, i) {
        txt = txt.replace(new RegExp("\\{\\{" + i + "\\}\\}", "gm"), args[i]);
      });
      return txt;
    };
    cc._RF.pop();
  }, {} ],
  SystemModel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "0ec23jeQsJKB5JsVHrPowhB", "SystemModel");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var IDataModel_1 = require("../IDataModel");
    var ViewModel_1 = require("../../main/modelView/ViewModel");
    var AudioMng_1 = require("../../manager/AudioMng");
    var KEY_SYSTEM = "system";
    var SystemModel = function(_super) {
      __extends(SystemModel, _super);
      function SystemModel() {
        var _this = _super.call(this, KEY_SYSTEM) || this;
        _this.InitData({
          music_state: 1,
          sound_state: 1,
          hero_click_sp: 0
        });
        _this.VMData = {
          localData: _this.getAllData(),
          exData: {}
        };
        ViewModel_1.VM.add(_this.VMData, "SystemModel");
        return _this;
      }
      Object.defineProperty(SystemModel.prototype, "is_open_music", {
        get: function() {
          return 1 == this.VMData.localData.music_state;
        },
        set: function(value) {
          value ? AudioMng_1.default.resumeBGM() : AudioMng_1.default.stopBGM();
          this.VMData.localData.music_state = value ? 1 : 0;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(SystemModel.prototype, "is_open_sound", {
        get: function() {
          return 1 == this.VMData.localData.sound_state;
        },
        set: function(value) {
          this.VMData.localData.sound_state = value ? 1 : 0;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(SystemModel.prototype, "heroClickSp", {
        get: function() {
          return 1 == this.VMData.localData.hero_click_sp;
        },
        enumerable: true,
        configurable: true
      });
      SystemModel.prototype.getMessageListeners = function() {
        return {};
      };
      return SystemModel;
    }(IDataModel_1.default);
    exports.default = SystemModel;
    cc._RF.pop();
  }, {
    "../../main/modelView/ViewModel": "ViewModel",
    "../../manager/AudioMng": "AudioMng",
    "../IDataModel": "IDataModel"
  } ],
  TcbMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7869fkGKq9E86KT26tsPXvR", "TcbMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var DataUtil_1 = require("../main/utils/DataUtil");
    var Log_1 = require("../main/utils/Log");
    var TcbMng = function() {
      function TcbMng() {
        this.app = null;
        this.lastUploadDate = {};
      }
      TcbMng.prototype.init = function() {
        this.app = cc.cloud && cc.cloud.initialize();
        var auth = this.app.auth({
          persistence: "none"
        });
        return auth.anonymousAuthProvider().signIn();
      };
      TcbMng.prototype.getData = function() {
        var _this = this;
        return new Promise(function(resolve, reject) {
          _this.app.callFunction({
            name: "function",
            data: {
              action: "getData"
            }
          }).then(function(res) {
            cc.log("function", res);
            var msg = res.result.msg;
            if (msg.startsWith("add user")) {
              var data_1 = res.result.data;
              Object.keys(data_1).forEach(function(key) {
                key.startsWith("_") || cc.sys.localStorage.setItem("model_" + key, JSON.stringify(data_1[key]));
              });
            } else if (msg.startsWith("get user data")) {
              var data_2 = res.result.data[0];
              Object.keys(data_2).forEach(function(key) {
                key.startsWith("_") || cc.sys.localStorage.setItem("model_" + key, JSON.stringify(data_2[key]));
              });
            }
            var KEY_IS_NEWER = "IS_NEWER";
            var isNewer = cc.sys.localStorage.setItem("" + KEY_IS_NEWER, 1);
            resolve(res);
          }).catch(reject);
        });
      };
      TcbMng.prototype.getServerTime = function() {
        return this.app.callFunction({
          name: "function",
          data: {
            action: "getServerTime"
          }
        });
      };
      TcbMng.prototype.uploadData = function(data) {
        var _this = this;
        var newdata = DataUtil_1.default.dataClean(data, this.lastUploadDate);
        var copy = DataUtil_1.default.deepCopy(data);
        Object.keys(copy).forEach(function(key) {
          _this.lastUploadDate[key] = copy[key];
        });
        cc.log(newdata);
        return this.app.callFunction({
          name: "function",
          data: {
            action: "submitData",
            newdata: newdata
          }
        }).then(function(res) {
          Log_1.Log.log(Log_1.LOG_TAG.TEST, res);
        }).catch(function(err) {
          Log_1.Log.error(err);
        });
      };
      TcbMng.prototype.getWorldRankData = function() {
        return this.app.callFunction({
          name: "function",
          data: {
            action: "getWorldRank"
          }
        });
      };
      return TcbMng;
    }();
    exports.default = new TcbMng();
    window["mgc"] && (window["wx"] = window["mgc"]);
    cc._RF.pop();
  }, {
    "../main/utils/DataUtil": "DataUtil",
    "../main/utils/Log": "Log"
  } ],
  TipsCoolItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "61bbfWSUDxAO4VyHcwUWa/t", "TipsCoolItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var TipsCoolItem = function(_super) {
      __extends(TipsCoolItem, _super);
      function TipsCoolItem() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.title = null;
        _this.tipLabel = null;
        _this.ready = true;
        return _this;
      }
      TipsCoolItem.prototype.playTip = function(title, message) {
        var _this = this;
        void 0 === message && (message = "");
        this.node.stopAllActions();
        this.ready = false;
        this.title.string = title;
        var oldTitlePos = this.title.node.position;
        if (message) this.tipLabel.node.active = true; else {
          this.title.node.y = 10;
          this.tipLabel.node.active = false;
        }
        this.title.string = title;
        this.tipLabel.string = message;
        this.reset();
        cc.tween(this.node).parallel(cc.tween().to(.2, {
          scaleX: {
            value: 1,
            easing: "backOut"
          }
        }), cc.tween().delay(.05).to(.2, {
          scaleY: {
            value: 1,
            easing: "backOut"
          }
        })).delay(2).parallel(cc.tween().to(.3, {
          scaleY: {
            value: .1,
            easing: "expoInOut"
          }
        }), cc.tween().delay(.1).to(.3, {
          scaleX: {
            value: .1,
            easing: "expoInOut"
          }
        }), cc.tween().then(cc.fadeOut(.4))).call(function() {
          _this.ready = true;
          _this.title.node.position = oldTitlePos;
        }).start();
      };
      TipsCoolItem.prototype.isReady = function() {
        return this.ready;
      };
      TipsCoolItem.prototype.reset = function() {
        this.node.setPosition(0, -20);
        this.node.opacity = 255;
        this.node.scaleX = .1;
        this.node.scaleY = .1;
      };
      __decorate([ property(cc.Label) ], TipsCoolItem.prototype, "title", void 0);
      __decorate([ property(cc.Label) ], TipsCoolItem.prototype, "tipLabel", void 0);
      TipsCoolItem = __decorate([ ccclass, menu("UI/Common/TipsItem") ], TipsCoolItem);
      return TipsCoolItem;
    }(cc.Component);
    exports.TipsCoolItem = TipsCoolItem;
    cc._RF.pop();
  }, {} ],
  TipsItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "3d560zbGIBFQLCIMpgcFG3L", "TipsItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var TipsItem = function(_super) {
      __extends(TipsItem, _super);
      function TipsItem() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.tipLabel = null;
        _this.ready = true;
        return _this;
      }
      TipsItem.prototype.playTip = function(message) {
        this.node.stopAllActions();
        this.ready = false;
        this.tipLabel.string = message;
        this.reset();
        var action0 = cc.moveTo(.5, 0, 128);
        var action1 = cc.fadeIn(.5);
        var action2 = cc.spawn(action0, action1);
        var action3 = cc.delayTime(1);
        var action4 = cc.fadeOut(.5);
        var callback = cc.callFunc(function() {
          this.ready = true;
        }, this);
        var action = cc.sequence(action2, action3, action4, callback);
        this.node.runAction(action);
      };
      TipsItem.prototype.isReady = function() {
        return this.ready;
      };
      TipsItem.prototype.reset = function() {
        this.node.setPosition(0, 0);
        this.node.opacity = 255;
      };
      __decorate([ property(cc.Label) ], TipsItem.prototype, "tipLabel", void 0);
      TipsItem = __decorate([ ccclass, menu("UI/Common/TipsItem") ], TipsItem);
      return TipsItem;
    }(cc.Component);
    exports.TipsItem = TipsItem;
    cc._RF.pop();
  }, {} ],
  UIBase: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "60b4enrFN1KerC5U3yOr5TF", "UIBase");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var EventMng_1 = require("../../manager/EventMng");
    var PREFAB_UI_DIR = "prefab/";
    var PREVIEW_USE_DIR = "previewUse/";
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var UIBase = function(_super) {
      __extends(UIBase, _super);
      function UIBase() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.isClickThrough = false;
        _this.showOpenAnima = true;
        return _this;
      }
      Object.defineProperty(UIBase.prototype, "tag", {
        get: function() {
          return this.mTag;
        },
        set: function(value) {
          this.mTag = value;
        },
        enumerable: true,
        configurable: true
      });
      UIBase.getUrl = function() {
        false;
        return PREFAB_UI_DIR + this.prefabUrl;
      };
      UIBase.getPreviewAtlasUrl = function() {
        return PREVIEW_USE_DIR + this.prefabUrl;
      };
      UIBase.getName = function() {
        return this.className;
      };
      UIBase.prototype.init = function(params) {
        this.onInit(params);
        this.showOpenAnima && this.showPopAnim();
      };
      UIBase.prototype.onLoad = function() {
        this._notifyEventList = new Map();
        this._registerEventList = new Map();
        this.onUILoad();
        this.onShow();
      };
      UIBase.prototype.onDestroy = function() {
        this.onUIDestroy();
      };
      UIBase.prototype.onEnable = function() {
        this.isClickThrough || this.onRegisterEvent(this.node, this.touchEvent, this, false);
        this.ui && this.onShow();
      };
      UIBase.prototype.onDisable = function() {
        this.unRegisterEvent(this.node, this.touchEvent, this);
        this.onHide();
        var self = this;
        this._notifyEventList.forEach(function(f, key) {
          EventMng_1.default.off(key, f, self);
        }, this);
        this._notifyEventList.clear();
      };
      UIBase.prototype.initEvent = function(eventName, cb) {
        EventMng_1.default.on(eventName, cb, this);
        this._notifyEventList.set(eventName, cb);
      };
      UIBase.prototype.touchEvent = function(event) {
        event.stopPropagation();
      };
      UIBase.prototype.start = function() {
        this.onStart();
      };
      UIBase.prototype.onInit = function(params) {};
      UIBase.prototype.onUILoad = function() {};
      UIBase.prototype.onUIDestroy = function() {};
      UIBase.prototype.onShow = function() {};
      UIBase.prototype.onHide = function() {};
      UIBase.prototype.onStart = function() {};
      UIBase.prototype.onClose = function() {};
      UIBase.prototype.onClickClose = function() {
        this.showOutAnim();
      };
      UIBase.prototype.showPopAnim = function() {
        cc.director.getActionManager().removeAllActionsFromTarget(this.node, false);
        cc.tween(this.node).by(0, {
          y: -60
        }).by(.2, {
          y: {
            value: 60,
            easing: "bounceOut"
          }
        }).start();
      };
      UIBase.prototype.showOutAnim = function(cb) {
        cc.director.getActionManager().removeAllActionsFromTarget(this.node, false);
        cb && cb();
        this.onClose();
      };
      UIBase.prototype.onRegisterEvent = function(node, callback, target, playAudio) {
        void 0 === target && (target = null);
        void 0 === playAudio && (playAudio = true);
        if (!node) return;
        node.on(cc.Node.EventType.TOUCH_END, callback, target);
      };
      UIBase.prototype.unRegisterEvent = function(node, callback, target) {
        void 0 === target && (target = null);
        node.off(cc.Node.EventType.TOUCH_END, callback, target);
      };
      UIBase = __decorate([ ccclass ], UIBase);
      return UIBase;
    }(cc.Component);
    exports.default = UIBase;
    cc._RF.pop();
  }, {
    "../../manager/EventMng": "EventMng"
  } ],
  UIConfirmDialog: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "685042Y8YRPS5xUTBCl4gJH", "UIConfirmDialog");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var UIBase_1 = require("../../main/ui/UIBase");
    var UIHelp_1 = require("../../main/ui/UIHelp");
    var Log_1 = require("../../main/utils/Log");
    var auto_confirmDialog_1 = require("../../../data/autoui/tips/auto_confirmDialog");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var UIConfirmDialog = function(_super) {
      __extends(UIConfirmDialog, _super);
      function UIConfirmDialog() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        return _this;
      }
      UIConfirmDialog_1 = UIConfirmDialog;
      UIConfirmDialog.prototype.onInit = function(params) {
        if (void 0 == params) {
          Log_1.Log.error("UIConfirmDialog:\u6ca1\u6709\u4f20\u5165\u53c2\u6570\uff01\uff01\uff01");
          return;
        }
        var data = params[0];
        this._title = data.title;
        this._content = data.content;
        this._certainCb = data.certainCb;
        this._cancelCb = data.cancelCb;
      };
      UIConfirmDialog.prototype.onUILoad = function() {
        this.ui = this.node.addComponent(auto_confirmDialog_1.default);
      };
      UIConfirmDialog.prototype.onShow = function() {
        this.onRegisterEvent(this.ui.btn_cancel, this.onCancel, this);
        this.onRegisterEvent(this.ui.btn_certain, this.onCertain, this);
      };
      UIConfirmDialog.prototype.onHide = function() {
        this.unRegisterEvent(this.ui.btn_cancel, this.onCancel, this);
        this.unRegisterEvent(this.ui.btn_certain, this.onCertain, this);
      };
      UIConfirmDialog.prototype.onStart = function() {
        UIHelp_1.default.SetLabel(this.ui.lbl_title, this._title);
        UIHelp_1.default.SetLabel(this.ui.lbl_content, this._content);
      };
      UIConfirmDialog.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIConfirmDialog_1);
      };
      UIConfirmDialog.prototype.onCancel = function() {
        this._cancelCb && this._cancelCb();
        this.onClose();
      };
      UIConfirmDialog.prototype.onCertain = function() {
        this._certainCb && this._certainCb();
        this.onClose();
      };
      var UIConfirmDialog_1;
      UIConfirmDialog.prefabUrl = "tips/confirmDialog";
      UIConfirmDialog.className = "UIConfirmDialog";
      UIConfirmDialog = UIConfirmDialog_1 = __decorate([ ccclass, menu("UI/tips/UIConfirmDialog") ], UIConfirmDialog);
      return UIConfirmDialog;
    }(UIBase_1.default);
    exports.default = UIConfirmDialog;
    cc._RF.pop();
  }, {
    "../../../data/autoui/tips/auto_confirmDialog": "auto_confirmDialog",
    "../../main/ui/UIBase": "UIBase",
    "../../main/ui/UIHelp": "UIHelp",
    "../../main/utils/Log": "Log"
  } ],
  UIDetailTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "81425GHvMZLRIFYfCm13CX8", "UIDetailTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_detailTip_1 = require("../../../data/autoui/tips/auto_detailTip");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var UIHelp_1 = require("../../../commonLib/main/ui/UIHelp");
    var GameController_1 = require("../../../commonLib/GameController");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var UIDetailTip = function(_super) {
      __extends(UIDetailTip, _super);
      function UIDetailTip() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        _this.data = null;
        _this.viodeBg = null;
        return _this;
      }
      UIDetailTip_1 = UIDetailTip;
      UIDetailTip.prototype.onUILoad = function() {
        this.ui = this.node.addComponent(auto_detailTip_1.default);
        this.initView();
      };
      UIDetailTip.prototype.onInit = function(params) {
        this.data = params[0];
      };
      UIDetailTip.prototype.initView = function() {
        this.ui.title.getComponent(cc.Label).string = this.data.title;
        var label = this.ui.RichText.getComponent(cc.Label);
        if (this.data.content.length > 14) {
          label.horizontalAlign = cc.Label.HorizontalAlign.LEFT;
          label.fontSize = 27;
        } else {
          label.horizontalAlign = cc.Label.HorizontalAlign.CENTER;
          label.fontSize = 30;
        }
        label.lineHeight = label.fontSize + 5;
        label.string = this.data.content;
        if (!this.data.cancelCb) {
          this.ui.Common_Button_Cancel.active = false;
          this.ui.Common_Button_Ok.x = 0;
        }
        if (!this.data.certainCb) {
          this.ui.Common_Button_Ok.active = false;
          this.ui.Common_Button_Cancel.x = 0;
        }
        this.data.certainTxt && (this.ui.Common_Button_Ok.getComponentInChildren(cc.Label).string = this.data.certainTxt);
        this.data.cancelTxt && (this.ui.Common_Button_Cancel.getComponentInChildren(cc.Label).string = this.data.cancelTxt);
        if (this.data.isAdType) {
          this.ui.Common_Button_Ok.getChildByName("video_icon").active = true;
          this.ui.Common_Button_Ok.getComponent(cc.Sprite).spriteFrame = this.viodeBg;
          this.ui.Common_Button_Ok.x = 110;
          this.ui.Common_Button_Cancel.x = -110;
        }
        this.data.setFunc && this.data.setFunc(this);
      };
      UIDetailTip.prototype.onShow = function() {};
      UIDetailTip.prototype.onHide = function() {};
      UIDetailTip.prototype.showPopAnim = function() {
        var bg = this.node.getChildByName("bg");
        cc.director.getActionManager().removeAllActionsFromTarget(bg, false);
        cc.tween(bg).by(0, {
          y: -60
        }).by(.2, {
          y: {
            value: 60,
            easing: "bounceOut"
          }
        }).start();
      };
      UIDetailTip.prototype.onStart = function() {
        this.data.cancelCb || this.data.certainCb || this.setCanTouchClose();
      };
      UIDetailTip.prototype.setCanTouchClose = function() {
        this.onRegisterEvent(this.node, this.onClose, this, false);
      };
      UIDetailTip.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIDetailTip_1);
      };
      UIDetailTip.prototype.onClickOk = function() {
        var _this = this;
        this.data.isAdType ? GameController_1.default.playVideoAd(function() {
          _this.showOutAnim(_this.data.certainCb);
        }, "" + this.data.title) : this.showOutAnim(this.data.certainCb);
      };
      UIDetailTip.prototype.onClickCancel = function() {
        this.showOutAnim(this.data.cancelCb);
      };
      var UIDetailTip_1;
      UIDetailTip.prefabUrl = "tips/detailTip";
      UIDetailTip.className = "UIDetailTip";
      __decorate([ property(cc.SpriteFrame) ], UIDetailTip.prototype, "viodeBg", void 0);
      UIDetailTip = UIDetailTip_1 = __decorate([ ccclass, menu("UI/tips/UIDetailTip") ], UIDetailTip);
      return UIDetailTip;
    }(UIBase_1.default);
    exports.default = UIDetailTip;
    cc._RF.pop();
  }, {
    "../../../commonLib/GameController": "GameController",
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/main/ui/UIHelp": "UIHelp",
    "../../../data/autoui/tips/auto_detailTip": "auto_detailTip"
  } ],
  UIGameOver: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "84b07DirgVLk5GuDwM4xFcH", "UIGameOver");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_gameOver_1 = require("./auto_gameOver");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var UIHelp_1 = require("../../../commonLib/main/ui/UIHelp");
    var GameMng_1 = require("../main/GameMng");
    var GameDataCenter_1 = require("../../../data/GameDataCenter");
    var SceneUtil_1 = require("../../../commonLib/main/resource/SceneUtil");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
    var UIGameOver = function(_super) {
      __extends(UIGameOver, _super);
      function UIGameOver() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        return _this;
      }
      UIGameOver_1 = UIGameOver;
      UIGameOver.prototype.onUILoad = function() {
        this.ui = this.node.getComponent(auto_gameOver_1.default);
        this.initView();
      };
      UIGameOver.prototype.onShow = function() {};
      UIGameOver.prototype.onHide = function() {};
      UIGameOver.prototype.onStart = function() {
        cc.find("Canvas/branches").opacity = 0;
      };
      UIGameOver.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIGameOver_1);
      };
      UIGameOver.prototype.addListener = function() {};
      UIGameOver.prototype.removeListener = function() {};
      UIGameOver.prototype.onClickRestart = function() {
        this.onClose();
        cc.find("Canvas/branches").opacity = 255;
        GameMng_1.default.initGame();
      };
      UIGameOver.prototype.initView = function() {
        var localData = GameDataCenter_1.default.account.getLocalData();
        var exData = GameDataCenter_1.default.account.getExData();
        exData.distance = Math.floor(exData.distance);
        this.ui.lblDistance.string = exData.distance.toString();
        var txt = "";
        if (exData.distance > localData.maxDistance) {
          txt = 0 == localData.maxDistance ? "\u521d\u6b21\u5230\u8fbe" + exData.distance + "m" : "\u7a81\u7834\u6700\u8fdc\u8ddd\u79bb" + (exData.distance - localData.maxDistance) + "m!";
          localData.maxDistance = exData.distance;
          GameDataCenter_1.default.account.Save();
        } else txt = "\u5386\u53f2\u6700\u8fdc\u8ddd\u79bb" + localData.maxDistance + "m!";
        this.ui.lblMaxDistance.string = txt;
        exData.distance = 0;
      };
      UIGameOver.prototype.onClickClose = function() {
        this.onClose();
        SceneUtil_1.default.switchScene("loading");
      };
      var UIGameOver_1;
      UIGameOver.prefabUrl = "gameOver/gameOver";
      UIGameOver.className = "UIGameOver";
      UIGameOver = UIGameOver_1 = __decorate([ ccclass, requireComponent(auto_gameOver_1.default) ], UIGameOver);
      return UIGameOver;
    }(UIBase_1.default);
    exports.default = UIGameOver;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/resource/SceneUtil": "SceneUtil",
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/main/ui/UIHelp": "UIHelp",
    "../../../data/GameDataCenter": "GameDataCenter",
    "../main/GameMng": "GameMng",
    "./auto_gameOver": "auto_gameOver"
  } ],
  UIHelp: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4c35dtT1lxGZrJmfR/ihnaN", "UIHelp");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var UIMng_1 = require("../../manager/UIMng");
    var ViewZOrder_1 = require("../../const/ViewZOrder");
    var UITips_1 = require("../../ui/tips/UITips");
    var UIConfirmDialog_1 = require("../../ui/tips/UIConfirmDialog");
    var UIDetailTip_1 = require("../../../main/ui/tips/UIDetailTip");
    var PrefabPool_1 = require("../resource/PrefabPool");
    var UILoadingTip_1 = require("../../../main/ui/tips/UILoadingTip");
    var WxCloudMng_1 = require("../../manager/WxCloudMng");
    var UIHelp = function() {
      function UIHelp() {}
      UIHelp.SetLabel = function(node, value) {
        "number" === typeof value ? value = value.toString() : void 0 == value && (value = "");
        if (node.getComponent(cc.RichText)) {
          var defaultColor = node.color.toHEX("#rrggbb");
          node.getComponent(cc.RichText).string = "<color=" + defaultColor + ">" + value + "</c>";
        } else node.getComponent(cc.Label).string = value;
      };
      UIHelp.SetBtnGrayState = function(node, isGray) {
        var button = node.getComponent(cc.Button);
        if (!button) return;
        button.interactable = !isGray;
        button.enableAutoGrayEffect = isGray;
      };
      UIHelp.IsBtnGray = function(node) {
        var button = node.getComponent(cc.Button);
        if (!button) return false;
        return !button.interactable;
      };
      UIHelp.ShowUI = function(uiClass) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) args[_i - 1] = arguments[_i];
        var i = 0;
        var callback = null;
        var node = null;
        if (args[i]) {
          if ("function" == typeof args[i]) {
            callback = args[i];
            args.splice(i, 1);
          }
          if ("cc.Node" == cc.js.getClassName(args[i])) {
            node = args[i];
            args.splice(i, 1);
          }
          if (node && !UIMng_1.default.getUI(uiClass) && PrefabPool_1.PrefabPoolMgr.hasPool(UILoadingTip_1.default.getUrl())) {
            var uiTip = node.getComponentInChildren(UILoadingTip_1.default);
            var tip_1 = null;
            if (uiTip) tip_1 = uiTip.node; else {
              tip_1 = PrefabPool_1.PrefabPoolMgr.getPool(UILoadingTip_1.default.getUrl()).getPrefab();
              tip_1.parent = node;
            }
            tip_1.getComponent(UILoadingTip_1.default).initView();
            var oldCallback_1 = callback;
            callback = function(uiView, err) {
              if (err) {
                tip_1.getComponent(UILoadingTip_1.default).showRetry();
                return;
              }
              PrefabPool_1.PrefabPoolMgr.getPool(UILoadingTip_1.default.getUrl()).freePrefab(tip_1, PrefabPool_1.FreeType.remove);
              oldCallback_1 && oldCallback_1(uiView);
            };
          }
        }
        UIMng_1.default.openUI.apply(UIMng_1.default, [ uiClass, ViewZOrder_1.ViewZorder.UI, callback, null ].concat(args));
        WxCloudMng_1.default.hideGameClub();
      };
      UIHelp.showUIByName = function(UIClassName) {
        var uiClass = cc.js.getClassByName(UIClassName);
        UIHelp.ShowUI(uiClass);
      };
      UIHelp.CloseUI = function(uiClass) {
        UIMng_1.default.closeUI(uiClass);
      };
      UIHelp.IsShowingUI = function(uiClass) {
        return UIMng_1.default.isShowing(uiClass);
      };
      UIHelp.ShowTips = function(message) {
        var param = [];
        for (var _i = 1; _i < arguments.length; _i++) param[_i - 1] = arguments[_i];
        var tipUI = UIMng_1.default.getUI(UITips_1.default);
        tipUI ? tipUI.showTip(message) : UIMng_1.default.openUI(UITips_1.default, ViewZOrder_1.ViewZorder.Tips, function(ui) {
          UIHelp.ShowTips(message);
        });
      };
      UIHelp.ShowCoolTips = function(title, content) {
        var tipUI = UIMng_1.default.getUI(UITips_1.default);
        tipUI ? tipUI.showCoolTip(title, content) : UIMng_1.default.openUI(UITips_1.default, ViewZOrder_1.ViewZorder.Tips, function(ui) {
          UIHelp.ShowCoolTips(title, content);
        });
      };
      UIHelp.ShowDialog = function(data) {
        UIMng_1.default.openUI(UIConfirmDialog_1.default, ViewZOrder_1.ViewZorder.Dialog, null, null, data);
      };
      UIHelp.ShowDetailTip = function(data, callback) {
        UIMng_1.default.openUI(UIDetailTip_1.default, ViewZOrder_1.ViewZorder.Dialog, callback, null, data);
      };
      return UIHelp;
    }();
    exports.default = UIHelp;
    false;
    cc._RF.pop();
  }, {
    "../../../main/ui/tips/UIDetailTip": "UIDetailTip",
    "../../../main/ui/tips/UILoadingTip": "UILoadingTip",
    "../../const/ViewZOrder": "ViewZOrder",
    "../../manager/UIMng": "UIMng",
    "../../manager/WxCloudMng": "WxCloudMng",
    "../../ui/tips/UIConfirmDialog": "UIConfirmDialog",
    "../../ui/tips/UITips": "UITips",
    "../resource/PrefabPool": "PrefabPool"
  } ],
  UILoadingTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "d7f1deOwGdKCKbTvXfPliNK", "UILoadingTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var auto_LoadingTip_1 = require("../../../data/autoui/tips/auto_LoadingTip");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var UILoadingTip = function(_super) {
      __extends(UILoadingTip, _super);
      function UILoadingTip() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        _this.isClickThrough = true;
        _this.showOpenAnima = false;
        _this.cantouch = false;
        return _this;
      }
      UILoadingTip.prototype.onUILoad = function() {
        this.ui = this.node.addComponent(auto_LoadingTip_1.default);
      };
      UILoadingTip.prototype.onShow = function() {};
      UILoadingTip.prototype.onHide = function() {};
      UILoadingTip.prototype.onStart = function() {
        this.onRegisterEvent(this.node, this.ontouch, this, false);
        this.node._touchListener.setSwallowTouches(false);
      };
      UILoadingTip.prototype.ontouch = function(event) {
        this.cantouch || event.stopPropagation();
      };
      UILoadingTip.prototype.initView = function() {
        this.ui = this.node.addComponent(auto_LoadingTip_1.default);
        this.ui.loading.active = true;
        this.ui.refresh.active = false;
        this.node.getComponent(cc.Widget).enabled = true;
        this.cantouch = false;
        this.node.position = cc.v2(0, 0);
      };
      UILoadingTip.prototype.showRetry = function() {
        this.ui.loading.active = false;
        this.ui.refresh.active = true;
        this.cantouch = true;
      };
      UILoadingTip.prototype.onClose = function() {};
      UILoadingTip.prefabUrl = "tips/LoadingTip";
      UILoadingTip.className = "UILoadingTip";
      UILoadingTip = __decorate([ ccclass, menu("UI/commonPrefab/UILoadingTip") ], UILoadingTip);
      return UILoadingTip;
    }(UIBase_1.default);
    exports.default = UILoadingTip;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../data/autoui/tips/auto_LoadingTip": "auto_LoadingTip"
  } ],
  UILoading: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "0857cRtkQNC+JKB9xrjU+I1", "UILoading");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var EventConst_1 = require("../../../commonLib/const/EventConst");
    var GameController_1 = require("../../../commonLib/GameController");
    var ViewModel_1 = require("../../../commonLib/main/modelView/ViewModel");
    var ResourceLoader_1 = require("../../../commonLib/main/resource/ResourceLoader");
    var SceneUtil_1 = require("../../../commonLib/main/resource/SceneUtil");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var EventMng_1 = require("../../../commonLib/manager/EventMng");
    var UIMng_1 = require("../../../commonLib/manager/UIMng");
    var GameDataCenter_1 = require("../../../data/GameDataCenter");
    var GameMng_1 = require("../../../main/ui/main/GameMng");
    var UIPlayerInfo_1 = require("../../../main/ui/playerInfo/UIPlayerInfo");
    var UIResponsibility_1 = require("../../../main/ui/responsibility/UIResponsibility");
    var auto_loading_1 = require("./auto_loading");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var isFirstLogin = true;
    var UILoading = function(_super) {
      __extends(UILoading, _super);
      function UILoading() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.tipLb = null;
        _this.transitions = null;
        _this.ui = null;
        return _this;
      }
      UILoading.prototype.onUILoad = function() {
        isFirstLogin && ResourceLoader_1.default.getInstance().initSceneResDeps();
        this.ui = this.node.getComponent(auto_loading_1.default);
        this.data = {
          progress: {
            min: 0,
            max: 100
          }
        };
        ViewModel_1.VM.add(this.data, "loginData");
        var transitions = cc.find("transitions");
        transitions && (this.transitions = transitions.getComponent("transitions"));
      };
      UILoading.prototype.onShow = function() {
        EventMng_1.default.on(EventConst_1.GameEvent.LOGIN_SUCCESS, this.onLoginSuccess, this);
      };
      UILoading.prototype.onHide = function() {
        EventMng_1.default.off(EventConst_1.GameEvent.LOGIN_SUCCESS, this.onLoginSuccess, this);
        ViewModel_1.VM.remove("loginData");
      };
      UILoading.prototype.onStart = function() {
        if (isFirstLogin) {
          GameController_1.default.init();
          GameDataCenter_1.default.initModule();
        }
        if (GameDataCenter_1.default.account.isNewPlayer()) {
          SceneUtil_1.default.preloadScene("main");
          this.ui.btnRankList.node.active = false;
          this.ui.btnEditInfo.node.active = false;
        } else {
          this.ui.btnEditInfo.node.active = false;
          this.ui.btnRankList.node.active = false;
        }
      };
      UILoading.prototype.onClickGameStart = function() {
        if (GameDataCenter_1.default.account.isNewPlayer()) UIMng_1.default.openUI(UIResponsibility_1.default); else {
          this.ui.btnPlayGame.node.active = false;
          this.onLoginSuccess();
        }
      };
      UILoading.prototype.onLoginSuccess = function() {
        var _this = this;
        cc.log("\u5f00\u59cb\u52a0\u8f7d...");
        SceneUtil_1.default.preloadScene("main", function(completedCount, totalCount) {
          _this.data.progress.min = completedCount;
          _this.data.progress.max = totalCount;
        }, function(error, asset) {
          if (null != error) {
            console.error(error, "\u5c1d\u8bd5\u91cd\u65b0\u4e0b\u8f7d");
            _this.onLoginSuccess();
            return;
          }
          cc.log("\u52a0\u8f7d\u6210\u529f\uff0c\u5207\u6362\u5230main");
          ViewModel_1.VM.remove("loginData");
          isFirstLogin = false;
          cc.sys.platform === cc.sys.WECHAT_GAME ? SceneUtil_1.default.switchScene("main") : _this.testSwitchScene();
        });
      };
      UILoading.prototype.testSwitchScene = function() {
        var transitions = this.transitions;
        this.transitions.loadScene("main", "Canvas/Main Camera", "Canvas/Main Camera", function() {
          GameMng_1.default.initGame();
        }, function() {});
      };
      UILoading.prototype.onClickMusic = function() {
        var value = !GameDataCenter_1.default.system.is_open_music;
        GameDataCenter_1.default.system.is_open_music = value;
        GameDataCenter_1.default.system.is_open_sound = value;
      };
      UILoading.prototype.onClickEditInfo = function() {
        UIMng_1.default.openUI(UIPlayerInfo_1.default);
      };
      UILoading.prefabUrl = "db://a";
      UILoading.className = "UILoading";
      __decorate([ property(cc.Label) ], UILoading.prototype, "tipLb", void 0);
      UILoading = __decorate([ ccclass, menu("UI/scene/UILoading") ], UILoading);
      return UILoading;
    }(UIBase_1.default);
    exports.default = UILoading;
    cc._RF.pop();
  }, {
    "../../../commonLib/GameController": "GameController",
    "../../../commonLib/const/EventConst": "EventConst",
    "../../../commonLib/main/modelView/ViewModel": "ViewModel",
    "../../../commonLib/main/resource/ResourceLoader": "ResourceLoader",
    "../../../commonLib/main/resource/SceneUtil": "SceneUtil",
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/manager/EventMng": "EventMng",
    "../../../commonLib/manager/UIMng": "UIMng",
    "../../../data/GameDataCenter": "GameDataCenter",
    "../../../main/ui/main/GameMng": "GameMng",
    "../../../main/ui/playerInfo/UIPlayerInfo": "UIPlayerInfo",
    "../../../main/ui/responsibility/UIResponsibility": "UIResponsibility",
    "./auto_loading": "auto_loading"
  } ],
  UIMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "095acjxR4dMrLp13+/TROMD", "UIMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewZOrder_1 = require("../const/ViewZOrder");
    var ResourceLoader_1 = require("../main/resource/ResourceLoader");
    var Log_1 = require("../main/utils/Log");
    var UIMng = function() {
      function UIMng() {
        this.uiList = [];
        this.loadedUI = [];
        this.loaderrNum = new Map();
      }
      UIMng.prototype.openUI = function(uiClass, zOrder, callback, onProgress) {
        var _this = this;
        void 0 === zOrder && (zOrder = ViewZOrder_1.ViewZorder.UI);
        var args = [];
        for (var _i = 4; _i < arguments.length; _i++) args[_i - 4] = arguments[_i];
        if (this.getUI(uiClass)) {
          this.showUI(uiClass, function(uiView) {
            uiView.init(args);
            callback && callback(uiView);
          });
          return;
        }
        if (this.loaderrNum.has(uiClass.getUrl())) {
          if (this.loaderrNum.get(uiClass.getUrl()) > 3) {
            Log_1.Log.log(uiClass.getUrl() + "\u52a0\u8f7d\u5931\u8d25\u8d85\u8fc73\u6b21,\u7ec8\u6b62\u91cd\u8bd5");
            this.loaderrNum.set(uiClass.getUrl(), 0);
            callback && callback(null, new Error("\u52a0\u8f7d\u5931\u8d25"));
            return;
          }
          this.loaderrNum.get(uiClass.getUrl()) >= 1 && Log_1.Log.log(uiClass.getUrl() + "\u8fdb\u884c\u7b2c" + this.loaderrNum.get(uiClass.getUrl()) + "\u6b21\u52a0\u8f7d\u91cd\u8bd5");
        } else this.loaderrNum.set(uiClass.getUrl(), 0);
        var argArr = Array.prototype.slice.call(arguments);
        ResourceLoader_1.default.getInstance().loadRes(uiClass.getUrl(), function(completedCount, totalCount, item) {
          onProgress && onProgress(completedCount, totalCount, item);
        }, function(error, prefab) {
          if (error) {
            _this.loaderrNum.set(uiClass.getUrl(), _this.loaderrNum.get(uiClass.getUrl()) + 1);
            _this.openUI.apply(_this, argArr);
            return;
          }
          _this.loaderrNum.set(uiClass.getUrl(), 0);
          if (_this.getUI(uiClass)) {
            console.error("UIMng OpenUI 2: ui " + uiClass.getName() + " is already exist, please check");
            callback && callback(null, new Error("\u5df2\u7ecf\u6709\u4e00\u4e2a\u76f8\u540cui\u4e86"));
            return;
          }
          _this.loadedUI.includes(uiClass.getUrl()) || _this.loadedUI.push(uiClass.getUrl());
          var uiNode = cc.instantiate(prefab);
          var ui = uiNode.getComponent(uiClass);
          if (!ui) {
            console.error(uiClass.getUrl() + "\u6ca1\u6709\u7ed1\u5b9aUI\u811a\u672c!!!");
            return;
          }
          var uiRoot = cc.director.getScene();
          if ("object" == typeof args[0]) {
            args[0].uiRoot && (uiRoot = args[0].uiRoot);
            args.splice(0, 1);
          }
          if (!uiRoot) {
            console.error("\u5f53\u524d\u573a\u666f" + cc.director.getScene().name + "Canvas!!!");
            return;
          }
          uiNode.zIndex = zOrder;
          uiNode.parent = uiRoot;
          ui.init(args);
          _this.uiList.push(ui);
          ui.tag = uiClass;
          callback && callback(ui);
        }, ResourceLoader_1.ResUse.UI);
      };
      UIMng.prototype.closeUI = function(uiClass) {
        for (var i = 0; i < this.uiList.length; ++i) if (this.uiList[i].tag === uiClass) {
          if (cc.isValid(this.uiList[i].node)) {
            this.uiList[i].node.destroy();
            ResourceLoader_1.default.getInstance().releaseRes(uiClass.getUrl());
          }
          this.uiList.splice(i, 1);
          return;
        }
      };
      UIMng.prototype.closeAllUI = function() {
        if (0 == this.uiList.length) return;
        this.closeUI(this.uiList[0].tag);
        while (this.uiList.length > 0) this.closeUI(this.uiList[0].tag);
      };
      UIMng.prototype.showUI = function(uiClass, callback) {
        var ui = this.getUI(uiClass);
        if (!ui) {
          console.error("UIMng showUI: ui " + uiClass.getName() + " not exist");
          return;
        }
        ui.node.active = true;
        callback && callback(ui);
      };
      UIMng.prototype.hideUI = function(uiClass) {
        var ui = this.getUI(uiClass);
        ui && (ui.node.active = false);
      };
      UIMng.prototype.getUI = function(uiClass) {
        for (var i = 0; i < this.uiList.length; ++i) if (this.uiList[i].tag === uiClass) return this.uiList[i];
        return null;
      };
      UIMng.prototype.isShowing = function(uiClass) {
        var ui = this.getUI(uiClass);
        if (!ui) return false;
        return ui.node.active;
      };
      return UIMng;
    }();
    var uiMng = new UIMng();
    exports.default = uiMng;
    false;
    cc._RF.pop();
  }, {
    "../const/ViewZOrder": "ViewZOrder",
    "../main/resource/ResourceLoader": "ResourceLoader",
    "../main/utils/Log": "Log"
  } ],
  UIPlayerInfo: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4b34frw+2ZH7KvgzLjd9WQy", "UIPlayerInfo");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_playerInfo_1 = require("./auto_playerInfo");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var UIHelp_1 = require("../../../commonLib/main/ui/UIHelp");
    var EventMng_1 = require("../../../commonLib/manager/EventMng");
    var EventConst_1 = require("../../../commonLib/const/EventConst");
    var GameDataCenter_1 = require("../../../data/GameDataCenter");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
    var UIPlayerInfo = function(_super) {
      __extends(UIPlayerInfo, _super);
      function UIPlayerInfo() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        return _this;
      }
      UIPlayerInfo_1 = UIPlayerInfo;
      UIPlayerInfo.prototype.onUILoad = function() {
        this.ui = this.node.getComponent(auto_playerInfo_1.default);
        this.initView();
      };
      UIPlayerInfo.prototype.onShow = function() {};
      UIPlayerInfo.prototype.onHide = function() {};
      UIPlayerInfo.prototype.onStart = function() {};
      UIPlayerInfo.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIPlayerInfo_1);
      };
      UIPlayerInfo.prototype.addListener = function() {};
      UIPlayerInfo.prototype.removeListener = function() {};
      UIPlayerInfo.prototype.onClickEnterGame = function() {
        var localData = GameDataCenter_1.default.account.getLocalData();
        localData.playerInfo.name = this.ui.useName.string;
        localData.playerInfo.idCard = this.ui.useIdCard.string;
        localData.playerInfo.phone = this.ui.usePhone.string;
        localData.playerInfo.address = this.ui.useAddress.string;
        var index = 0;
        this.ui.useSex.toggleItems.forEach(function(toggle, i) {
          toggle.isChecked && (index = i);
        });
        localData.playerInfo.sex = 0 == index ? "\u7537" : "\u5973";
        this.onClose();
        GameDataCenter_1.default.account.isNewPlayer() && EventMng_1.default.emit(EventConst_1.GameEvent.LOGIN_SUCCESS);
      };
      UIPlayerInfo.prototype.initView = function() {
        var localData = GameDataCenter_1.default.account.getLocalData();
        this.ui.useName.string = localData.playerInfo.name;
        this.ui.useIdCard.string = localData.playerInfo.idCard;
        this.ui.usePhone.string = localData.playerInfo.phone;
        this.ui.useAddress.string = localData.playerInfo.address;
        this.ui.useSex.toggleItems.forEach(function(toggle, i) {
          toggle.isChecked = "\u7537" == localData.playerInfo.sex && 0 == i;
        });
        GameDataCenter_1.default.account.isNewPlayer() || (this.ui.btnEnter.getComponentInChildren(cc.Label).string = "\u786e\u5b9a");
      };
      var UIPlayerInfo_1;
      UIPlayerInfo.prefabUrl = "playerInfo/playerInfo";
      UIPlayerInfo.className = "UIPlayerInfo";
      UIPlayerInfo = UIPlayerInfo_1 = __decorate([ ccclass, requireComponent(auto_playerInfo_1.default) ], UIPlayerInfo);
      return UIPlayerInfo;
    }(UIBase_1.default);
    exports.default = UIPlayerInfo;
    cc._RF.pop();
  }, {
    "../../../commonLib/const/EventConst": "EventConst",
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/main/ui/UIHelp": "UIHelp",
    "../../../commonLib/manager/EventMng": "EventMng",
    "../../../data/GameDataCenter": "GameDataCenter",
    "./auto_playerInfo": "auto_playerInfo"
  } ],
  UIResponsibility: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "37016bjwsVJ9Zgvbl1Lb5Ig", "UIResponsibility");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_responsibility_1 = require("./auto_responsibility");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var UIHelp_1 = require("../../../commonLib/main/ui/UIHelp");
    var UIMng_1 = require("../../../commonLib/manager/UIMng");
    var UIPlayerInfo_1 = require("../playerInfo/UIPlayerInfo");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
    var UIResponsibility = function(_super) {
      __extends(UIResponsibility, _super);
      function UIResponsibility() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        return _this;
      }
      UIResponsibility_1 = UIResponsibility;
      UIResponsibility.prototype.onUILoad = function() {
        this.ui = this.node.getComponent(auto_responsibility_1.default);
      };
      UIResponsibility.prototype.onShow = function() {
        var _this = this;
        this.ui.lblAgree.string = "\u540c\u610f(5s)";
        var i = 5;
        cc.tween(this.ui.lblAgree).repeat(i, cc.tween().delay(1).call(function() {
          _this.ui.lblAgree.string = "\u540c\u610f(" + --i + "s)";
        })).call(function() {
          _this.ui.lblAgree.string = "\u540c\u610f";
          _this.ui.btnEnter.interactable = true;
        }).start();
      };
      UIResponsibility.prototype.onHide = function() {};
      UIResponsibility.prototype.onStart = function() {};
      UIResponsibility.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIResponsibility_1);
      };
      UIResponsibility.prototype.addListener = function() {};
      UIResponsibility.prototype.removeListener = function() {};
      UIResponsibility.prototype.onClickClose = function() {
        this.onClose();
        UIMng_1.default.openUI(UIPlayerInfo_1.default);
      };
      var UIResponsibility_1;
      UIResponsibility.prefabUrl = "playerInfo/responsibility";
      UIResponsibility.className = "UIResponsibility";
      UIResponsibility = UIResponsibility_1 = __decorate([ ccclass, requireComponent(auto_responsibility_1.default) ], UIResponsibility);
      return UIResponsibility;
    }(UIBase_1.default);
    exports.default = UIResponsibility;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/main/ui/UIHelp": "UIHelp",
    "../../../commonLib/manager/UIMng": "UIMng",
    "../playerInfo/UIPlayerInfo": "UIPlayerInfo",
    "./auto_responsibility": "auto_responsibility"
  } ],
  UITips: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2ec48tTpqpNIKhowpOmw7IH", "UITips");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var TipsItem_1 = require("./TipsItem");
    var UIBase_1 = require("../../main/ui/UIBase");
    var TipsCoolItem_1 = require("./TipsCoolItem");
    var _a = cc._decorator, ccclass = _a.ccclass, menu = _a.menu, property = _a.property;
    var UITips = function(_super) {
      __extends(UITips, _super);
      function UITips() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.isClickThrough = true;
        _this.tipPrefab = null;
        _this.tipCoolPrefab = null;
        _this.tipPool = [];
        _this.tipCoolPool = [];
        return _this;
      }
      UITips.prototype.onStart = function() {};
      UITips.prototype.showTip = function(message) {
        for (var i = 0; i < this.tipPool.length; ++i) if (null != this.tipPool[i] && this.tipPool[i].isReady()) {
          this.tipPool[i].playTip(message);
          return;
        }
        var TipNode = cc.instantiate(this.tipPrefab);
        TipNode.parent = this.node;
        var tip = TipNode.getComponent(TipsItem_1.TipsItem);
        this.tipPool.push(tip);
        tip.playTip(message);
      };
      UITips.prototype.showCoolTip = function(message, content) {
        for (var i = 0; i < this.tipCoolPool.length; ++i) if (null != this.tipCoolPool[i] && this.tipCoolPool[i].isReady()) {
          this.tipCoolPool[i].playTip(message, content);
          return;
        }
        var TipNode = cc.instantiate(this.tipCoolPrefab);
        TipNode.parent = this.node;
        var tip = TipNode.getComponent(TipsCoolItem_1.TipsCoolItem);
        this.tipCoolPool.push(tip);
        tip.playTip(message, content);
      };
      UITips.prototype.onClose = function() {};
      UITips.prefabUrl = "tips/tips";
      UITips.className = "UITips";
      __decorate([ property(cc.Prefab) ], UITips.prototype, "tipPrefab", void 0);
      __decorate([ property(cc.Prefab) ], UITips.prototype, "tipCoolPrefab", void 0);
      UITips = __decorate([ ccclass, menu("UI/Common/UITips") ], UITips);
      return UITips;
    }(UIBase_1.default);
    exports.default = UITips;
    cc._RF.pop();
  }, {
    "../../main/ui/UIBase": "UIBase",
    "./TipsCoolItem": "TipsCoolItem",
    "./TipsItem": "TipsItem"
  } ],
  UIWorldRankList: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "46fabnPa61KbKiZKCRGA0Ki", "UIWorldRankList");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var auto_worldRankList_1 = require("./auto_worldRankList");
    var UIBase_1 = require("../../../commonLib/main/ui/UIBase");
    var UIHelp_1 = require("../../../commonLib/main/ui/UIHelp");
    var GameDataCenter_1 = require("../../../data/GameDataCenter");
    var TcbMng_1 = require("../../../commonLib/manager/TcbMng");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var UIWorldRankList = function(_super) {
      __extends(UIWorldRankList, _super);
      function UIWorldRankList() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.ui = null;
        _this.dataArr = [];
        _this.hasShowedOutAbuna = false;
        return _this;
      }
      UIWorldRankList_1 = UIWorldRankList;
      UIWorldRankList.prototype.onUILoad = function() {
        this.ui = this.node.addComponent(auto_worldRankList_1.default);
        this.node.opacity = 0;
        this.node.getComponent(cc.Widget).updateAlignment();
        this.refreshSelf(-1);
      };
      UIWorldRankList.prototype.onShow = function() {};
      UIWorldRankList.prototype.onHide = function() {};
      UIWorldRankList.prototype.onStart = function() {
        this.loadData();
      };
      UIWorldRankList.prototype.onClose = function() {
        UIHelp_1.default.CloseUI(UIWorldRankList_1);
      };
      UIWorldRankList.prototype.addListener = function() {};
      UIWorldRankList.prototype.removeListener = function() {};
      UIWorldRankList.prototype.listRender = function(item, idx) {
        item.listItem.initData(this.dataArr[idx], idx + 1);
      };
      UIWorldRankList.prototype.loadData = function() {
        var _this = this;
        TcbMng_1.default.getWorldRankData().then(function(res) {
          cc.log("\u6392\u884c\u699c\u6570\u636e", res);
          _this.dataArr = res.result.data;
          _this.ui.fltScrollView.numItems = _this.dataArr.length;
          _this.findSelf();
        });
      };
      UIWorldRankList.prototype.findSelf = function() {
        var localData = GameDataCenter_1.default.account.getLocalData();
        var rank = "\u672a\u4e0a\u699c";
        for (var index = 0; index < this.dataArr.length; index++) {
          var element = this.dataArr[index];
          if (element._id == localData.uid) {
            rank = index + 1;
            break;
          }
        }
        this.refreshSelf(rank);
      };
      UIWorldRankList.prototype.refreshSelf = function(rank) {
        void 0 === rank && (rank = -1);
        var localData = GameDataCenter_1.default.account.getLocalData();
        -1 == rank || this.ui.fltRankItem.refreshRank(rank);
      };
      UIWorldRankList.prototype.showPopAnim = function() {};
      UIWorldRankList.prototype.showOutAnim = function(cb) {};
      var UIWorldRankList_1;
      UIWorldRankList.prefabUrl = "rankList/worldRankList";
      UIWorldRankList.className = "UIWorldRankList";
      UIWorldRankList = UIWorldRankList_1 = __decorate([ ccclass ], UIWorldRankList);
      return UIWorldRankList;
    }(UIBase_1.default);
    exports.default = UIWorldRankList;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/ui/UIBase": "UIBase",
    "../../../commonLib/main/ui/UIHelp": "UIHelp",
    "../../../commonLib/manager/TcbMng": "TcbMng",
    "../../../data/GameDataCenter": "GameDataCenter",
    "./auto_worldRankList": "auto_worldRankList"
  } ],
  UiUtil: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "9f9881znmZD/6KSReRSYUHx", "UiUtil");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMBtnGray_1 = require("../modelView/VMBtnGray");
    var VMCustom_1 = require("../modelView/VMCustom");
    var VMEvent_1 = require("../modelView/VMEvent");
    var VMLabel_1 = require("../modelView/VMLabel");
    var VMProgress_1 = require("../modelView/VMProgress");
    var VMState_1 = require("../modelView/VMState");
    var UiUtil = function() {
      function UiUtil() {}
      UiUtil.prototype.initMvvm = function(parentNode, id, replaceAll) {
        void 0 === replaceAll && (replaceAll = true);
        var vmLabels = parentNode.getComponentsInChildren(VMLabel_1.default);
        var vmStates = parentNode.getComponentsInChildren(VMState_1.default);
        var vmGrays = parentNode.getComponentsInChildren(VMBtnGray_1.default);
        var vmProgresss = parentNode.getComponentsInChildren(VMProgress_1.default);
        var vmCustoms = parentNode.getComponentsInChildren(VMCustom_1.default);
        var vmEvents = parentNode.getComponentsInChildren(VMEvent_1.default);
        parentNode.getComponent(VMLabel_1.default) && vmLabels.push(parentNode.getComponent(VMLabel_1.default));
        parentNode.getComponent(VMState_1.default) && vmStates.push(parentNode.getComponent(VMState_1.default));
        parentNode.getComponent(VMBtnGray_1.default) && vmGrays.push(parentNode.getComponent(VMBtnGray_1.default));
        parentNode.getComponent(VMProgress_1.default) && vmProgresss.push(parentNode.getComponent(VMProgress_1.default));
        vmLabels.forEach(function(vmlabel) {
          vmlabel.onDisable();
          vmlabel.templateMode ? vmlabel.watchPathArr.forEach(function(path, index) {
            vmlabel.watchPathArr[index] = path.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          }) : vmlabel.watchPath = vmlabel.watchPath.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          vmlabel.enabled && vmlabel.node.active && vmlabel.onEnable();
        });
        vmStates.forEach(function(vmState) {
          vmState.onDisable();
          vmState.templateMode ? vmState.watchPathArr.forEach(function(path, index) {
            vmState.watchPathArr[index] = path.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          }) : vmState.watchPath = vmState.watchPath.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          vmState.enabled && vmState.node.active && vmState.onEnable();
        });
        vmGrays.forEach(function(vmgray) {
          vmgray.onDisable();
          vmgray.templateMode ? vmgray.watchPathArr.forEach(function(path, index) {
            vmgray.watchPathArr[index] = path.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          }) : vmgray.watchPath = vmgray.watchPath.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          vmgray.enabled && vmgray.node.active && vmgray.onEnable();
        });
        vmProgresss.forEach(function(vmProgress) {
          cc.director.getActionManager().removeAllActionsFromTarget(vmProgress._watchComponent, false);
          vmProgress.onDisable();
          vmProgress.watchPathArr.forEach(function(path, index) {
            vmProgress.watchPathArr[index] = path.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          });
          vmProgress.node.active && vmProgress.onEnable();
        });
        vmCustoms.forEach(function(vmCustom) {
          vmCustom.onDisable();
          vmCustom.watchPath = vmCustom.watchPath.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          vmCustom.enabled && vmCustom.node.active && vmCustom.onEnable();
        });
        vmEvents.forEach(function(vmEvent) {
          vmEvent.onDisable();
          vmEvent.templateMode ? vmEvent.watchPathArr.forEach(function(path, index) {
            vmEvent.watchPathArr[index] = path.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          }) : vmEvent.watchPath = vmEvent.watchPath.replace(new RegExp("\\.\\d+", replaceAll ? "g" : ""), "." + id);
          vmEvent.enabled && vmEvent.node.active && vmEvent.onEnable();
        });
        var buttons = parentNode.getComponentsInChildren(cc.Button);
        parentNode.getComponent(cc.Button) && buttons.push(parentNode.getComponent(cc.Button));
        buttons.forEach(function(button) {
          button.clickEvents[1] && (button.clickEvents[1].customEventData = id.toString());
        });
      };
      UiUtil.prototype.getIcon = function(imgArr, name) {
        for (var index = 0; index < imgArr.length; index++) {
          var element = imgArr[index];
          if (element && element.name == name) return element;
        }
      };
      return UiUtil;
    }();
    exports.default = new UiUtil();
    cc._RF.pop();
  }, {
    "../modelView/VMBtnGray": "VMBtnGray",
    "../modelView/VMCustom": "VMCustom",
    "../modelView/VMEvent": "VMEvent",
    "../modelView/VMLabel": "VMLabel",
    "../modelView/VMProgress": "VMProgress",
    "../modelView/VMState": "VMState"
  } ],
  Utils: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "90fc29nKkZKf6X2hqBDtLuy", "Utils");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var Utils = function() {
      function Utils() {}
      Utils.prototype.getSpriteSize = function(G) {
        var O = new Array(), d = "", t = "", s = 0, A = G.lastIndexOf("."), B = true;
        while (B) {
          A--;
          if (0 == s && this.isNumber(G.charAt(A))) d = G.charAt(A) + d; else if (0 == s && d.length > 0 && "x" == G.charAt(A)) {
            A--;
            s = 1;
            t = G.charAt(A) + t;
          } else if (1 == s && this.isNumber(G.charAt(A))) t = G.charAt(A) + t; else if (1 == s && t.length > 0 && "_" == G.charAt(A)) {
            B = false;
            O = [ parseInt(t), parseInt(d) ];
          } else {
            B = false;
            O = [ 0, 0 ];
          }
        }
        return O;
      };
      Utils.prototype.isNumber = function(G) {
        return !isNaN(parseFloat(G)) && isFinite(G);
      };
      return Utils;
    }();
    exports.Utils = Utils;
    cc._RF.pop();
  }, {} ],
  VMBase: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2f6f36IvUdPO7xynnVTPgzb", "VMBase");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewModel_1 = require("./ViewModel");
    var DEBUG_WATCH_PATH = false;
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var VMBase = function(_super) {
      __extends(VMBase, _super);
      function VMBase() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.watchPathArr = [];
        _this.templateMode = false;
        _this.templateValueArr = [];
        _this.VM = ViewModel_1.VM;
        return _this;
      }
      VMBase.prototype.onLoad = function() {
        var _this = this;
        false;
        var paths = this.watchPath.split(".");
        for (var i = 1; i < paths.length; i++) {
          var p = paths[i];
          if ("*" == p) {
            var index = this.node.getParent().children.findIndex(function(n) {
              return n === _this.node;
            });
            index <= 0 && (index = 0);
            paths[i] = index.toString();
            break;
          }
        }
        this.watchPath = paths.join(".");
        var pathArr = this.watchPathArr;
        if (pathArr.length >= 1) for (var i = 0; i < pathArr.length; i++) {
          var path = pathArr[i];
          var paths_1 = path.split(".");
          for (var i_1 = 1; i_1 < paths_1.length; i_1++) {
            var p = paths_1[i_1];
            if ("*" == p) {
              var index = this.node.getParent().children.findIndex(function(n) {
                return n === _this.node;
              });
              index <= 0 && (index = 0);
              paths_1[i_1] = index.toString();
              break;
            }
          }
          this.watchPathArr[i] = paths_1.join(".");
        }
        DEBUG_WATCH_PATH && true && cc.log("\u6240\u6709\u8def\u5f84", this.watchPath ? [ this.watchPath ] : this.watchPathArr, "<<", this.node.getParent().name + "." + this.node.name);
        "" == this.watchPath && "" == this.watchPathArr.join("") && cc.log("\u53ef\u80fd\u672a\u8bbe\u7f6e\u8def\u5f84\u7684\u8282\u70b9:", this.node.getParent().name + "." + this.node.name);
      };
      VMBase.prototype.onEnable = function() {
        false;
        this.templateMode ? this.setMultPathEvent(true) : "" != this.watchPath && this.VM.bindPath(this.watchPath, this.onValueChanged, this);
        this.onValueInit();
      };
      VMBase.prototype.onDisable = function() {
        false;
        this.templateMode ? this.setMultPathEvent(false) : "" != this.watchPath && this.VM.unbindPath(this.watchPath, this.onValueChanged, this);
      };
      VMBase.prototype.setMultPathEvent = function(enabled) {
        void 0 === enabled && (enabled = true);
        false;
        var arr = this.watchPathArr;
        for (var i = 0; i < arr.length; i++) {
          var path = arr[i];
          isNaN(path) && (enabled ? this.VM.bindPath(path, this.onValueChanged, this) : this.VM.unbindPath(path, this.onValueChanged, this));
        }
      };
      VMBase.prototype.onValueInit = function() {};
      VMBase.prototype.onValueChanged = function(n, o, pathArr) {};
      VMBase = __decorate([ ccclass ], VMBase);
      return VMBase;
    }(cc.Component);
    exports.default = VMBase;
    cc._RF.pop();
  }, {
    "./ViewModel": "ViewModel"
  } ],
  VMBtnGray: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7b32b5vFFtLCK/LurQ3lR6W", "VMBtnGray");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewModel_1 = require("./ViewModel");
    var VMBase_1 = require("./VMBase");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, help = _a.help;
    var CONDITION;
    (function(CONDITION) {
      CONDITION[CONDITION["=="] = 0] = "==";
      CONDITION[CONDITION["!="] = 1] = "!=";
      CONDITION[CONDITION[">"] = 2] = ">";
      CONDITION[CONDITION[">="] = 3] = ">=";
      CONDITION[CONDITION["<"] = 4] = "<";
      CONDITION[CONDITION["<="] = 5] = "<=";
      CONDITION[CONDITION["range"] = 6] = "range";
    })(CONDITION || (CONDITION = {}));
    exports.VMSTATE_CONDITION = CONDITION;
    var VMBtnGray = function(_super) {
      __extends(VMBtnGray, _super);
      function VMBtnGray() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.templateMode = true;
        _this.watchPathArr = [];
        _this.condition = CONDITION["=="];
        _this.valueA = 0;
        _this.valueB = 0;
        _this.isBanBtn = false;
        _this.notGraySprites = [];
        _this.grayMaterial = null;
        _this.btns = [];
        _this.sprites = [];
        _this.labels = [];
        _this.lastCheckState = false;
        return _this;
      }
      VMBtnGray.prototype.onLoad = function() {
        var _this = this;
        _super.prototype.onLoad.call(this);
        this.btns = this.node.getComponentsInChildren(cc.Button);
        var btn = this.node.getComponent(cc.Button);
        btn && this.btns.unshift(btn);
        this.sprites = this.node.getComponentsInChildren(cc.Sprite);
        var sprite = this.node.getComponent(cc.Sprite);
        sprite && this.sprites.unshift(sprite);
        this.notGraySprites.forEach(function(sprite) {
          for (var i = 0; i < _this.sprites.length; i++) if (sprite == _this.sprites[i]) {
            _this.sprites.splice(i, 1);
            i--;
          }
        });
        this.labels = this.node.getComponentsInChildren(cc.Label);
        var label = this.node.getComponent(cc.Label);
        label && this.labels.unshift(label);
        this.labels.forEach(function(label) {
          label.node._oldColor = label.node.color;
        });
      };
      VMBtnGray.prototype.start = function() {
        this.enabled && this.onValueInit();
      };
      VMBtnGray.prototype.onValueInit = function() {
        if (this.templateMode) {
          var max = this.watchPathArr.length;
          for (var i = 0; i < max; i++) this.templateValueArr[i] = this.VM.getValue(this.watchPathArr[i], "?");
          this.checkNodeFromValue(this.templateValueArr[0], this.templateValueArr[1]);
        } else {
          var value = ViewModel_1.VM.getValue(this.watchPath);
          this.checkNodeFromValue(value);
        }
      };
      VMBtnGray.prototype.onValueChanged = function(newVar, oldVar, pathArr) {
        if (false === this.templateMode) this.checkNodeFromValue(newVar); else {
          var path_1 = pathArr.join(".");
          var index = this.watchPathArr.findIndex(function(v) {
            return v === path_1;
          });
          index >= 0 && (this.templateValueArr[index] = newVar);
          if (0 == index) {
            var getValue = this.templateValueArr[1];
            this.checkNodeFromValue(newVar, getValue);
          } else if (1 == index) {
            var getValue = this.templateValueArr[0];
            this.checkNodeFromValue(getValue, newVar);
          }
        }
      };
      VMBtnGray.prototype.checkNodeFromValue = function(value, valueA) {
        var check = this.conditionCheck(value, null != valueA ? valueA : this.valueA, this.valueB);
        this.setNodesStates(check);
      };
      VMBtnGray.prototype.setNodesStates = function(checkState) {
        var normalMaterial = cc.Material.getBuiltinMaterial("2d-sprite");
        var grayMaterial = this.grayMaterial ? this.grayMaterial : cc.Material.getBuiltinMaterial("2d-gray-sprite");
        if (checkState != this.lastCheckState) {
          this.lastCheckState = checkState;
          this.isBanBtn && this.btns.forEach(function(btn) {
            btn.interactable = !checkState;
          });
          this.sprites.forEach(function(sprite) {
            grayMaterial && sprite.setMaterial(0, checkState ? grayMaterial : normalMaterial);
          });
          this.labels.forEach(function(label) {
            var color = label.node._oldColor;
            label.node.opacity = checkState ? .7 * color.getA() : color.getA();
          });
        }
      };
      VMBtnGray.prototype.conditionCheck = function(v, a, b) {
        var cod = CONDITION;
        switch (this.condition) {
         case cod["=="]:
          if (v == a) return true;
          break;

         case cod["!="]:
          if (v != a) return true;
          break;

         case cod["<"]:
          if (v < a) return true;
          break;

         case cod[">"]:
          if (v > a) return true;
          break;

         case cod[">="]:
          if (v >= a) return true;
          break;

         case cod["<"]:
          if (v < a) return true;
          break;

         case cod["<="]:
          if (v <= a) return true;
          break;

         case cod["range"]:
          if (v >= a && v <= b) return true;
        }
        return false;
      };
      __decorate([ property({
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMBtnGray.prototype, "watchPath", void 0);
      __decorate([ property({
        displayName: "dynamicMode",
        tooltip: "\u662f\u5426\u662f2\u4e2a\u52a8\u6001\u503c"
      }) ], VMBtnGray.prototype, "templateMode", void 0);
      __decorate([ property({
        type: [ cc.String ],
        visible: function() {
          return true === this.templateMode;
        }
      }) ], VMBtnGray.prototype, "watchPathArr", void 0);
      __decorate([ property({
        type: cc.Enum(CONDITION),
        tooltip: "\u6ee1\u8db3\u6761\u4ef6\uff0c\u6309\u94ae\u7f6e\u7070"
      }) ], VMBtnGray.prototype, "condition", void 0);
      __decorate([ property({
        displayName: "Value: a",
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMBtnGray.prototype, "valueA", void 0);
      __decorate([ property({
        displayName: "Value: b",
        visible: function() {
          return false === this.templateMode && this.condition === CONDITION.range;
        }
      }) ], VMBtnGray.prototype, "valueB", void 0);
      __decorate([ property({
        tooltip: "\u7f6e\u7070\u65f6\u6309\u94ae\u662f\u5426\u7981\u7528"
      }) ], VMBtnGray.prototype, "isBanBtn", void 0);
      __decorate([ property({
        type: [ cc.Sprite ],
        tooltip: "\u4e0d\u7f6e\u7070\u7684\u56fe\u7247"
      }) ], VMBtnGray.prototype, "notGraySprites", void 0);
      __decorate([ property({
        type: cc.Material,
        tooltip: "\u7f6e\u7070\u7684\u6750\u8d28\uff0c\u4e0d\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7070\u8272\u6750\u8d28"
      }) ], VMBtnGray.prototype, "grayMaterial", void 0);
      VMBtnGray = __decorate([ ccclass, menu("ModelViewer/VM-BtnGray (VM\u6309\u94ae\u53d8\u7070)") ], VMBtnGray);
      return VMBtnGray;
    }(VMBase_1.default);
    exports.default = VMBtnGray;
    cc._RF.pop();
  }, {
    "./VMBase": "VMBase",
    "./ViewModel": "ViewModel"
  } ],
  VMCompsEdit: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2359eFXKF5HFYS74K7Y17/U", "VMCompsEdit");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, menu = _a.menu, help = _a.help;
    var ACTION_MODE;
    (function(ACTION_MODE) {
      ACTION_MODE[ACTION_MODE["SEARCH_COMPONENT"] = 0] = "SEARCH_COMPONENT";
      ACTION_MODE[ACTION_MODE["ENABLE_COMPONENT"] = 1] = "ENABLE_COMPONENT";
      ACTION_MODE[ACTION_MODE["REPLACE_WATCH_PATH"] = 2] = "REPLACE_WATCH_PATH";
      ACTION_MODE[ACTION_MODE["DELETE_COMPONENT"] = 3] = "DELETE_COMPONENT";
    })(ACTION_MODE || (ACTION_MODE = {}));
    var MVCompsEdit = function(_super) {
      __extends(MVCompsEdit, _super);
      function MVCompsEdit() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.findList = [ "VMBase", "VMParent" ];
        _this.actionType = ACTION_MODE.SEARCH_COMPONENT;
        _this.allowDelete = false;
        _this.targetPath = "game";
        _this.replacePath = "*";
        _this.canCollectNodes = false;
        _this.collectNodes = [];
        return _this;
      }
      Object.defineProperty(MVCompsEdit.prototype, "findTrigger", {
        get: function() {
          return false;
        },
        set: function(v) {
          this.setComponents(0);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(MVCompsEdit.prototype, "enableTrigger", {
        get: function() {
          return false;
        },
        set: function(v) {
          this.setComponents(1);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(MVCompsEdit.prototype, "disableTrigger", {
        get: function() {
          return false;
        },
        set: function(v) {
          this.setComponents(2);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(MVCompsEdit.prototype, "deleteTrigger", {
        get: function() {
          return false;
        },
        set: function(v) {
          this.setComponents(3);
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(MVCompsEdit.prototype, "replaceTrigger", {
        get: function() {
          return false;
        },
        set: function(v) {
          this.setComponents(4);
        },
        enumerable: true,
        configurable: true
      });
      MVCompsEdit.prototype.onLoad = function() {
        true;
        var path = this.getNodePath(this.node);
        console.error("you forget delete MVEditFinder,[path]", path);
      };
      MVCompsEdit.prototype.setComponents = function(state) {
        var _this = this;
        var array = this.findList;
        var title = "\u641c\u7d22\u5230\u5f53\u524d\u8282\u70b9\u4e0b\u9762\u7684\u7ec4\u4ef6";
        switch (state) {
         case 0:
          title = "\u641c\u7d22\u5230\u5f53\u524d\u8282\u70b9\u4e0b\u9762\u7684\u7ec4\u4ef6";
          break;

         case 1:
          title = "\u6fc0\u6d3b\u4ee5\u4e0b\u8282\u70b9\u7684\u7ec4\u4ef6";
          break;

         case 2:
          title = "\u5173\u95ed\u4ee5\u4e0b\u8282\u70b9\u7684\u7ec4\u4ef6";
          break;

         case 3:
          title = "\u5220\u9664\u4ee5\u4e0b\u8282\u70b9\u7684\u7ec4\u4ef6";
          break;

         case 4:
          title = "\u66ff\u6362\u4ee5\u4e0b\u8282\u70b9\u7684\u8def\u5f84";
        }
        cc.log(title);
        cc.log("______________________");
        array.forEach(function(name) {
          _this.searchComponent(name, state);
        });
        cc.log("______________________");
      };
      MVCompsEdit.prototype.searchComponent = function(className, state) {
        var _this = this;
        void 0 === state && (state = 0);
        this.collectNodes = [];
        var comps = this.node.getComponentsInChildren(className);
        if (null == comps || comps.length < 1) return;
        cc.log("[" + className + "]:");
        comps.forEach(function(v) {
          var ext = "";
          state <= 3 && (ext = true === v.templateMode ? v.watchPathArr ? ":[Path:" + v.watchPathArr.join("|") + "]" : "" : v.watchPath ? ":[Path:" + v.watchPath + "]" : "");
          cc.log(_this.getNodePath(v.node) + ext);
          switch (state) {
           case 0:
            _this.canCollectNodes && -1 === _this.collectNodes.indexOf(v.node) && _this.collectNodes.push(v.node);
            break;

           case 1:
            v.enabled = true;
            break;

           case 2:
            v.enabled = false;
            break;

           case 3:
            v.node.removeComponent(v);
            break;

           case 4:
            var targetPath = _this.targetPath;
            var replacePath = _this.replacePath;
            if (true === v.templateMode) for (var i = 0; i < v.watchPathArr.length; i++) {
              var path = v.watchPathArr[i];
              v.watchPathArr[i] = _this.replaceNodePath(path, targetPath, replacePath);
            } else v.watchPath = _this.replaceNodePath(v.watchPath, targetPath, replacePath);
          }
        });
      };
      MVCompsEdit.prototype.replaceNodePath = function(path, search, replace) {
        return path.replace(search, replace);
      };
      MVCompsEdit.prototype.getNodePath = function(node) {
        var parent = node;
        var array = [];
        while (parent) {
          var p = parent.getParent();
          if (!p) break;
          array.push(parent.name);
          parent = p;
        }
        return array.reverse().join("/");
      };
      __decorate([ property({
        type: [ cc.String ]
      }) ], MVCompsEdit.prototype, "findList", void 0);
      __decorate([ property({
        type: cc.Enum(ACTION_MODE)
      }) ], MVCompsEdit.prototype, "actionType", void 0);
      __decorate([ property({
        tooltip: "\u52fe\u9009\u540e,\u4f1a\u81ea\u52a8\u67e5\u627e find list \u4e2d\u586b\u5199\u7684\u7ec4\u4ef6",
        visible: function() {
          return this.actionType === ACTION_MODE.SEARCH_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "findTrigger", null);
      __decorate([ property({
        tooltip: "\u52fe\u9009\u540e,\u4f1a\u6279\u91cf\u6fc0\u6d3b find list \u4e2d\u586b\u5199\u7684\u7ec4\u4ef6",
        visible: function() {
          return this.actionType === ACTION_MODE.ENABLE_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "enableTrigger", null);
      __decorate([ property({
        tooltip: "\u52fe\u9009\u540e,\u4f1a\u6279\u91cf\u5173\u95ed find list \u4e2d\u586b\u5199\u7684\u7ec4\u4ef6",
        visible: function() {
          return this.actionType === ACTION_MODE.ENABLE_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "disableTrigger", null);
      __decorate([ property({
        tooltip: "\u5141\u8bb8\u5220\u9664\u8282\u70b9\u7684\u7ec4\u4ef6,\u786e\u5b9a\u9700\u8981\u79fb\u9664\u8bf7\u52fe\u9009,\u9632\u6b62\u8bef\u64cd\u4f5c",
        visible: function() {
          return this.actionType === ACTION_MODE.DELETE_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "allowDelete", void 0);
      __decorate([ property({
        tooltip: "\u52fe\u9009\u540e,\u4f1a\u6279\u91cf\u5220\u9664 find list \u4e2d\u586b\u5199\u7684\u7ec4\u4ef6",
        displayName: "[ X DELETE X ]",
        visible: function() {
          return this.allowDelete && this.actionType === ACTION_MODE.DELETE_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "deleteTrigger", null);
      __decorate([ property({
        tooltip: "\u52fe\u9009\u540e,\u4f1a\u6279\u91cf\u66ff\u6362\u6389\u6307\u5b9a\u7684\u8def\u5f84",
        visible: function() {
          return this.actionType === ACTION_MODE.REPLACE_WATCH_PATH;
        }
      }) ], MVCompsEdit.prototype, "replaceTrigger", null);
      __decorate([ property({
        tooltip: "\u5339\u914d\u7684\u8def\u5f84,\u5339\u914d\u89c4\u5219: \u641c\u7d22\u5f00\u5934\u4e3a game\u7684\u8def\u5f84",
        visible: function() {
          return this.actionType === ACTION_MODE.REPLACE_WATCH_PATH;
        }
      }) ], MVCompsEdit.prototype, "targetPath", void 0);
      __decorate([ property({
        tooltip: "\u66ff\u6362\u7684\u8def\u5f84,\u5c06\u5339\u914d\u5230\u7684\u8def\u5f84\u66ff\u6362",
        visible: function() {
          return this.actionType === ACTION_MODE.REPLACE_WATCH_PATH;
        }
      }) ], MVCompsEdit.prototype, "replacePath", void 0);
      __decorate([ property({
        tooltip: "\u662f\u5426\u641c\u96c6\u7ed1\u5b9aVM\u7ec4\u4ef6\u7684\u8282\u70b9?",
        visible: function() {
          return this.actionType === ACTION_MODE.SEARCH_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "canCollectNodes", void 0);
      __decorate([ property({
        type: [ cc.Node ],
        readonly: true,
        tooltip: "\u6536\u96c6\u5230\u7ed1\u5b9a\u4e86VM\u7ec4\u4ef6\u76f8\u5173\u7684\u8282\u70b9\uff0c\u53ef\u4ee5\u81ea\u5df1\u8df3\u8f6c\u8fc7\u53bb",
        visible: function() {
          return this.canCollectNodes && this.actionType === ACTION_MODE.SEARCH_COMPONENT;
        }
      }) ], MVCompsEdit.prototype, "collectNodes", void 0);
      MVCompsEdit = __decorate([ ccclass, executeInEditMode, menu("ModelViewer/Edit-Comps (\u5feb\u901f\u7ec4\u4ef6\u64cd\u4f5c)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMCompsEdit.md") ], MVCompsEdit);
      return MVCompsEdit;
    }(cc.Component);
    exports.default = MVCompsEdit;
    cc._RF.pop();
  }, {} ],
  VMCustom: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ce662fwsSVPLKpmHx+KocFu", "VMCustom");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMBase_1 = require("./VMBase");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, menu = _a.menu, help = _a.help;
    var COMP_ARRAY_CHECK = [ [ "BhvFrameIndex", "index", false ], [ "BhvGroupToggle", "index", false ], [ "BhvRollNumber", "targetValue", false ], [ "cc.Label", "string", false ], [ "cc.RichText", "string", false ], [ "cc.EditBox", "string", true ], [ "cc.Slider", "progress", true ], [ "cc.ProgressBar", "progress", false ], [ "cc.Toggle", "isChecked", true ] ];
    var VMCustom = function(_super) {
      __extends(VMCustom, _super);
      function VMCustom() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.controller = false;
        _this.watchPath = "";
        _this.componentName = "";
        _this.componentProperty = "";
        _this.refreshRate = .1;
        _this._timer = 0;
        _this._watchComponent = null;
        _this._canWatchComponent = false;
        _this._oldValue = null;
        return _this;
      }
      VMCustom.prototype.onLoad = function() {
        _super.prototype.onLoad.call(this);
        this.checkEditorComponent();
        true;
        this._watchComponent = this.node.getComponent(this.componentName);
        this.checkComponentState();
      };
      VMCustom.prototype.onRestore = function() {
        this.checkEditorComponent();
      };
      VMCustom.prototype.start = function() {
        this.onValueInit();
      };
      VMCustom.prototype.checkEditorComponent = function() {
        var checkArray;
        var i;
        var params;
        var comp;
        false;
      };
      VMCustom.prototype.checkComponentState = function() {
        this._canWatchComponent = false;
        if (!this._watchComponent) {
          console.error("\u672a\u8bbe\u7f6e\u9700\u8981\u76d1\u542c\u7684\u7ec4\u4ef6");
          return;
        }
        if (!this.componentProperty) {
          console.error("\u672a\u8bbe\u7f6e\u9700\u8981\u76d1\u542c\u7684\u7ec4\u4ef6 \u7684\u5c5e\u6027");
          return;
        }
        if (this.componentProperty in this._watchComponent === false) {
          console.error("\u9700\u8981\u76d1\u542c\u7684\u7ec4\u4ef6\u7684\u5c5e\u6027\u4e0d\u5b58\u5728");
          return;
        }
        this._canWatchComponent = true;
      };
      VMCustom.prototype.getComponentValue = function() {
        return this._watchComponent[this.componentProperty];
      };
      VMCustom.prototype.setComponentValue = function(value) {
        if ("cc.Toggle" == this.componentName) {
          true == value && this.node.getComponent(cc.Toggle).check();
          false == value && this.node.getComponent(cc.Toggle).uncheck();
        } else this._watchComponent && (this._watchComponent[this.componentProperty] = value);
      };
      VMCustom.prototype.onValueInit = function() {
        false;
        this.setComponentValue(this.VM.getValue(this.watchPath));
      };
      VMCustom.prototype.onValueController = function(newValue, oldValue) {
        this.VM.setValue(this.watchPath, newValue);
      };
      VMCustom.prototype.onValueChanged = function(n, o, pathArr) {
        this.setComponentValue(n);
      };
      VMCustom.prototype.update = function(dt) {
        false;
        if (!this.controller) return;
        if (!this._canWatchComponent || false === this._watchComponent["enabled"]) return;
        this._timer += dt;
        if (this._timer < this.refreshRate) return;
        this._timer = 0;
        var oldValue = this._oldValue;
        var newValue = this.getComponentValue();
        if (this._oldValue === newValue) return;
        this._oldValue = this.getComponentValue();
        this.onValueController(newValue, oldValue);
      };
      __decorate([ property({
        tooltip: "\u6fc0\u6d3bcontroller,\u4ee5\u5f00\u542f\u53cc\u5411\u7ed1\u5b9a\uff0c\u5426\u5219\u53ea\u80fd\u63a5\u6536\u6d88\u606f"
      }) ], VMCustom.prototype, "controller", void 0);
      __decorate([ property ], VMCustom.prototype, "watchPath", void 0);
      __decorate([ property({
        tooltip: "\u7ed1\u5b9a\u7ec4\u4ef6\u7684\u540d\u5b57"
      }) ], VMCustom.prototype, "componentName", void 0);
      __decorate([ property({
        tooltip: "\u7ec4\u4ef6\u4e0a\u9700\u8981\u76d1\u542c\u7684\u5c5e\u6027"
      }) ], VMCustom.prototype, "componentProperty", void 0);
      __decorate([ property({
        tooltip: "\u5237\u65b0\u95f4\u9694\u9891\u7387(\u53ea\u5f71\u54cd\u810f\u68c0\u67e5\u7684\u9891\u7387)",
        step: .01,
        range: [ 0, 1 ],
        visible: function() {
          return true === this.controller;
        }
      }) ], VMCustom.prototype, "refreshRate", void 0);
      VMCustom = __decorate([ ccclass, executeInEditMode, menu("ModelViewer/VM-Custom (\u81ea\u5b9a\u4e49VM)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMCustom.md") ], VMCustom);
      return VMCustom;
    }(VMBase_1.default);
    exports.default = VMCustom;
    cc._RF.pop();
  }, {
    "./VMBase": "VMBase"
  } ],
  VMEvent: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "a9ce7kf8XZJeLPlT2iWn2zD", "VMEvent");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMBase_1 = require("./VMBase");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, menu = _a.menu, help = _a.help;
    var FILTER_MODE;
    (function(FILTER_MODE) {
      FILTER_MODE[FILTER_MODE["none"] = 0] = "none";
      FILTER_MODE[FILTER_MODE["=="] = 1] = "==";
      FILTER_MODE[FILTER_MODE["!="] = 2] = "!=";
      FILTER_MODE[FILTER_MODE[">"] = 3] = ">";
      FILTER_MODE[FILTER_MODE[">="] = 4] = ">=";
      FILTER_MODE[FILTER_MODE["<"] = 5] = "<";
      FILTER_MODE[FILTER_MODE["<="] = 6] = "<=";
    })(FILTER_MODE || (FILTER_MODE = {}));
    var VMEvent = function(_super) {
      __extends(VMEvent, _super);
      function VMEvent() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.templateMode = false;
        _this.watchPath = "";
        _this.triggerOnce = false;
        _this.watchPathArr = [];
        _this.filterMode = FILTER_MODE.none;
        _this.compareValue = "";
        _this.changeEvents = [];
        return _this;
      }
      VMEvent.prototype.onValueInit = function() {
        var _this = this;
        false;
        if (Array.isArray(this.changeEvents)) {
          var value_1 = this.VM.getValue(this.watchPath);
          this.changeEvents.forEach(function(v) {
            v.emit([ {
              target: _this.node,
              newVar: value_1,
              oldVar: null,
              pathArr: _this.templateMode ? _this.watchPathArr : [ _this.watchPath ]
            } ]);
          });
        }
      };
      VMEvent.prototype.onValueChanged = function(newVar, oldVar, pathArr) {
        var _this = this;
        var res = this.conditionCheck(newVar, this.compareValue);
        if (!res) return;
        Array.isArray(this.changeEvents) && this.changeEvents.forEach(function(v) {
          v.emit([ {
            target: _this.node,
            newVar: newVar,
            oldVar: oldVar,
            pathArr: _this.templateMode ? _this.watchPathArr : [ _this.watchPath ]
          } ]);
        });
        true === this.triggerOnce && (this.enabled = false);
      };
      VMEvent.prototype.conditionCheck = function(a, b) {
        var cod = FILTER_MODE;
        switch (this.filterMode) {
         case cod.none:
          return true;

         case cod["=="]:
          if (a == b) return true;
          break;

         case cod["!="]:
          if (a != b) return true;
          break;

         case cod["<"]:
          if (a < b) return true;
          break;

         case cod[">"]:
          if (a > b) return true;
          break;

         case cod[">="]:
          if (a >= b) return true;
          break;

         case cod["<"]:
          if (a < b) return true;
          break;

         case cod["<="]:
          if (a <= b) return true;
        }
        return false;
      };
      __decorate([ property({
        tooltip: "\u4f7f\u7528\u6a21\u677f\u6a21\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u8def\u5f84\u76d1\u542c"
      }) ], VMEvent.prototype, "templateMode", void 0);
      __decorate([ property({
        tooltip: "\u76d1\u542c\u83b7\u53d6\u503c\u7684\u8def\u5f84",
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMEvent.prototype, "watchPath", void 0);
      __decorate([ property({
        tooltip: "\u89e6\u53d1\u4e00\u6b21\u540e\u4f1a\u81ea\u52a8\u5173\u95ed\u8be5\u4e8b\u4ef6"
      }) ], VMEvent.prototype, "triggerOnce", void 0);
      __decorate([ property({
        tooltip: "\u76d1\u542c\u83b7\u53d6\u503c\u7684\u591a\u6761\u8def\u5f84,\u8fd9\u4e9b\u503c\u7684\u6539\u53d8\u90fd\u4f1a\u901a\u8fc7\u8fd9\u4e2a\u51fd\u6570\u56de\u8c03,\u8bf7\u4f7f\u7528 pathArr \u533a\u5206\u83b7\u53d6\u7684\u503c ",
        type: [ cc.String ],
        visible: function() {
          return true === this.templateMode;
        }
      }) ], VMEvent.prototype, "watchPathArr", void 0);
      __decorate([ property({
        tooltip: "\u8fc7\u6ee4\u6a21\u5f0f\uff0c\u4f1a\u6839\u636e\u6761\u4ef6\u8fc7\u6ee4\u6389\u65f6\u95f4\u7684\u89e6\u53d1",
        type: cc.Enum(FILTER_MODE)
      }) ], VMEvent.prototype, "filterMode", void 0);
      __decorate([ property({
        visible: function() {
          return this.filterMode !== FILTER_MODE.none;
        }
      }) ], VMEvent.prototype, "compareValue", void 0);
      __decorate([ property([ cc.Component.EventHandler ]) ], VMEvent.prototype, "changeEvents", void 0);
      VMEvent = __decorate([ ccclass, executeInEditMode, menu("ModelViewer/VM-EventCall(\u8c03\u7528\u51fd\u6570)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMEvent.md") ], VMEvent);
      return VMEvent;
    }(VMBase_1.default);
    exports.default = VMEvent;
    cc._RF.pop();
  }, {
    "./VMBase": "VMBase"
  } ],
  VMLabelInCode: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "db8bdb/ggFIg7MuhqZIDSol", "VMLabelInCode");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMLabel_1 = require("./VMLabel");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, executeInEditMode = _a.executeInEditMode, help = _a.help;
    var VMLabelInCode = function(_super) {
      __extends(VMLabelInCode, _super);
      function VMLabelInCode() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      VMLabelInCode.prototype.onLoad = function() {};
      VMLabelInCode.prototype.start = function() {};
      VMLabelInCode.prototype.onEnable = function() {};
      VMLabelInCode.prototype.init = function() {
        var _this = this;
        _super.prototype.onLoad.call(this);
        _super.prototype.start.call(this);
        this.onEnable = function() {
          _super.prototype.onEnable.call(_this);
        };
      };
      VMLabelInCode = __decorate([ ccclass ], VMLabelInCode);
      return VMLabelInCode;
    }(VMLabel_1.default);
    exports.default = VMLabelInCode;
    cc._RF.pop();
  }, {
    "./VMLabel": "VMLabel"
  } ],
  VMLabel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "545c05XsG9GDJispEGWKvYv", "VMLabel");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMBase_1 = require("./VMBase");
    var StringFormat_1 = require("./StringFormat");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, executeInEditMode = _a.executeInEditMode, help = _a.help;
    var LABEL_TYPE = {
      CC_LABEL: "cc.Label",
      CC_RICH_TEXT: "cc.RichText",
      CC_EDIT_BOX: "cc.EditBox"
    };
    var VMLabel = function(_super) {
      __extends(VMLabel, _super);
      function VMLabel() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.labelType = LABEL_TYPE.CC_LABEL;
        _this.templateMode = false;
        _this.watchPathArr = [];
        _this.templateValueArr = [];
        _this.templateFormatArr = [];
        _this.originText = null;
        return _this;
      }
      VMLabel.prototype.onRestore = function() {
        this.checkLabel();
      };
      VMLabel.prototype.onLoad = function() {
        _super.prototype.onLoad.call(this);
        this.checkLabel();
        true;
        if (this.templateMode && !this.originText) {
          this.originText = this.getLabelValue();
          this.parseTemplate();
        }
      };
      VMLabel.prototype.start = function() {
        false;
        this.onValueInit();
      };
      VMLabel.prototype.parseTemplate = function() {
        var regexAll = /\{\{(.+?)\}\}/g;
        var regex = /\{\{(.+?)\}\}/;
        var res = this.originText.match(regexAll);
        if (null == res) return;
        for (var i = 0; i < res.length; i++) {
          var e = res[i];
          var arr = e.match(regex);
          var matchName = arr[1];
          var matchInfo = matchName.split(":")[1] || "";
          this.templateFormatArr[i] = matchInfo;
        }
      };
      VMLabel.prototype.getReplaceText = function() {
        if (!this.originText) return "";
        var regexAll = /\{\{(.+?)\}\}/g;
        var regex = /\{\{(.+?)\}\}/;
        var res = this.originText.match(regexAll);
        if (null == res) return "";
        var str = this.originText;
        for (var i = 0; i < res.length; i++) {
          var e = res[i];
          var getValue = void 0;
          var arr = e.match(regex);
          var indexNum = parseInt(arr[1] || "0") || 0;
          var format = this.templateFormatArr[i];
          getValue = this.templateValueArr[indexNum];
          str = str.replace(e, this.getValueFromFormat(getValue, format));
        }
        return str;
      };
      VMLabel.prototype.getValueFromFormat = function(value, format) {
        return StringFormat_1.StringFormatFunction.deal(value, format);
      };
      VMLabel.prototype.onValueInit = function() {
        if (this.templateMode && !this.originText) {
          this.checkLabel();
          this.originText = this.getLabelValue();
          this.parseTemplate();
        }
        if (false === this.templateMode) this.setLabelValue(this.VM.getValue(this.watchPath)); else {
          var max = this.watchPathArr.length;
          for (var i = 0; i < max; i++) this.templateValueArr[i] = this.VM.getValue(this.watchPathArr[i], "?");
          this.setLabelValue(this.getReplaceText());
        }
      };
      VMLabel.prototype.onValueChanged = function(n, o, pathArr) {
        if (false === this.templateMode) this.setLabelValue(n); else {
          var path_1 = pathArr.join(".");
          var index = this.watchPathArr.findIndex(function(v) {
            return v === path_1;
          });
          if (index >= 0) {
            this.templateValueArr[index] = n;
            this.setLabelValue(this.getReplaceText());
          }
        }
      };
      VMLabel.prototype.setLabelValue = function(value) {
        this.getComponent(this.labelType).string = value + "";
      };
      VMLabel.prototype.getLabelValue = function() {
        return this.getComponent(this.labelType).string;
      };
      VMLabel.prototype.checkLabel = function() {
        var checkArray = [ "cc.Label", "cc.RichText", "cc.EditBox" ];
        for (var i = 0; i < checkArray.length; i++) {
          var e = checkArray[i];
          var comp = this.node.getComponent(e);
          if (comp) {
            this.labelType = e;
            return true;
          }
        }
        cc.error("\u6ca1\u6709\u6302\u8f7d\u4efb\u4f55label\u7ec4\u4ef6");
        return false;
      };
      __decorate([ property({
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMLabel.prototype, "watchPath", void 0);
      __decorate([ property({
        readonly: true
      }) ], VMLabel.prototype, "labelType", void 0);
      __decorate([ property({
        tooltip: "\u662f\u5426\u542f\u7528\u6a21\u677f\u4ee3\u7801,\u53ea\u80fd\u5728\u8fd0\u884c\u65f6\u4e4b\u524d\u8bbe\u7f6e,\n\u5c06\u4f1a\u52a8\u6001\u89e3\u6790\u6a21\u677f\u8bed\u6cd5 {{0}},\u5e76\u4e14\u81ea\u52a8\u8bbe\u7f6e\u76d1\u542c\u7684\u8def\u5f84"
      }) ], VMLabel.prototype, "templateMode", void 0);
      __decorate([ property({
        type: [ cc.String ],
        visible: function() {
          return true === this.templateMode;
        }
      }) ], VMLabel.prototype, "watchPathArr", void 0);
      VMLabel = __decorate([ ccclass, executeInEditMode, menu("ModelViewer/VM-Label(\u6587\u672cVM)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMLabel.md") ], VMLabel);
      return VMLabel;
    }(VMBase_1.default);
    exports.default = VMLabel;
    cc._RF.pop();
  }, {
    "./StringFormat": "StringFormat",
    "./VMBase": "VMBase"
  } ],
  VMModify: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7d2a4voaOJJGJZRWFPG6Bk7", "VMModify");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMBase_1 = require("./VMBase");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, help = _a.help;
    var CLAMP_MODE;
    (function(CLAMP_MODE) {
      CLAMP_MODE[CLAMP_MODE["MIN"] = 0] = "MIN";
      CLAMP_MODE[CLAMP_MODE["MAX"] = 1] = "MAX";
      CLAMP_MODE[CLAMP_MODE["MIN_MAX"] = 2] = "MIN_MAX";
    })(CLAMP_MODE || (CLAMP_MODE = {}));
    var VMModify = function(_super) {
      __extends(VMModify, _super);
      function VMModify() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.valueClamp = false;
        _this.valueClampMode = CLAMP_MODE.MIN_MAX;
        _this.valueMin = 0;
        _this.valueMax = 1;
        return _this;
      }
      VMModify.prototype.start = function() {};
      VMModify.prototype.clampValue = function(res) {
        var min = this.valueMin;
        var max = this.valueMax;
        if (false == this.valueClamp) return res;
        switch (this.valueClampMode) {
         case CLAMP_MODE.MIN_MAX:
          res > max && (res = max);
          res < min && (res = min);
          break;

         case CLAMP_MODE.MIN:
          res < min && (res = min);
          break;

         case CLAMP_MODE.MAX:
          res > max && (res = max);
        }
        return res;
      };
      VMModify.prototype.vAddInt = function(e, data) {
        this.vAdd(e, data, true);
      };
      VMModify.prototype.vSubInt = function(e, data) {
        this.vSub(e, data, true);
      };
      VMModify.prototype.vMulInt = function(e, data) {
        this.vMul(e, data, true);
      };
      VMModify.prototype.vDivInt = function(e, data) {
        this.vDiv(e, data, true);
      };
      VMModify.prototype.vAdd = function(e, data, int) {
        void 0 === int && (int = false);
        var a = parseFloat(data);
        var res = this.VM.getValue(this.watchPath, 0) + a;
        int && (res = Math.round(res));
        this.VM.setValue(this.watchPath, this.clampValue(res));
      };
      VMModify.prototype.vSub = function(e, data, int) {
        void 0 === int && (int = false);
        var a = parseFloat(data);
        var res = this.VM.getValue(this.watchPath, 0) - a;
        int && (res = Math.round(res));
        this.VM.setValue(this.watchPath, this.clampValue(res));
      };
      VMModify.prototype.vMul = function(e, data, int) {
        void 0 === int && (int = false);
        var a = parseFloat(data);
        var res = this.VM.getValue(this.watchPath, 0) * a;
        int && (res = Math.round(res));
        this.VM.setValue(this.watchPath, this.clampValue(res));
      };
      VMModify.prototype.vDiv = function(e, data, int) {
        void 0 === int && (int = false);
        var a = parseFloat(data);
        var res = this.VM.getValue(this.watchPath, 0) / a;
        int && (res = Math.round(res));
        this.VM.setValue(this.watchPath, this.clampValue(res));
      };
      VMModify.prototype.vString = function(e, data) {
        var a = data;
        this.VM.setValue(this.watchPath, a);
      };
      VMModify.prototype.vNumberInt = function(e, data) {
        this.vNumber(e, data, true);
      };
      VMModify.prototype.vNumber = function(e, data, int) {
        void 0 === int && (int = false);
        var a = parseFloat(data);
        int && (a = Math.round(a));
        this.VM.setValue(this.watchPath, this.clampValue(a));
      };
      __decorate([ property ], VMModify.prototype, "watchPath", void 0);
      __decorate([ property() ], VMModify.prototype, "valueClamp", void 0);
      __decorate([ property({
        type: cc.Enum(CLAMP_MODE),
        visible: function() {
          return true === this.valueClamp;
        }
      }) ], VMModify.prototype, "valueClampMode", void 0);
      __decorate([ property({
        visible: function() {
          return true === this.valueClamp && this.valueClampMode !== CLAMP_MODE.MAX;
        }
      }) ], VMModify.prototype, "valueMin", void 0);
      __decorate([ property({
        visible: function() {
          return true === this.valueClamp && this.valueClampMode !== CLAMP_MODE.MIN;
        }
      }) ], VMModify.prototype, "valueMax", void 0);
      VMModify = __decorate([ ccclass, menu("ModelViewer/VM-Modify(\u4fee\u6539Model)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMModify.md") ], VMModify);
      return VMModify;
    }(VMBase_1.default);
    exports.default = VMModify;
    cc._RF.pop();
  }, {
    "./VMBase": "VMBase"
  } ],
  VMParent: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "15ccciO+ZRH476sPKD/LvB7", "VMParent");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewModel_1 = require("./ViewModel");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, help = _a.help, executionOrder = _a.executionOrder;
    var VMParent = function(_super) {
      __extends(VMParent, _super);
      function VMParent() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.tag = "_temp";
        _this.data = {};
        _this.VM = ViewModel_1.VM;
        return _this;
      }
      VMParent.prototype.onLoad = function() {
        this.onBind();
        if (null == this.data) return;
        this.tag = "_temp<" + this.node.uuid.replace(".", "") + ">";
        ViewModel_1.VM.add(this.data, this.tag);
        var comps = this.getVMComponents();
        for (var i = 0; i < comps.length; i++) {
          var comp = comps[i];
          this.replaceVMPath(comp, this.tag);
        }
      };
      VMParent.prototype.onBind = function() {};
      VMParent.prototype.onUnBind = function() {};
      VMParent.prototype.replaceVMPath = function(comp, tag) {
        var path = comp["watchPath"];
        if (true == comp["templateMode"]) {
          var pathArr = comp["watchPathArr"];
          if (pathArr) for (var i = 0; i < pathArr.length; i++) {
            var path_1 = pathArr[i];
            pathArr[i] = path_1.replace("*", tag);
          }
        } else "*" === path.split(".")[0] && (comp["watchPath"] = path.replace("*", tag));
      };
      VMParent.prototype.getVMComponents = function() {
        var _this = this;
        var comps = this.node.getComponentsInChildren("VMBase");
        var parents = this.node.getComponentsInChildren("VMParent").filter(function(v) {
          return v.uuid !== _this.uuid;
        });
        var filters = [];
        parents.forEach(function(node) {
          filters = filters.concat(node.getComponentsInChildren("VMBase"));
        });
        comps = comps.filter(function(v) {
          return filters.indexOf(v) < 0;
        });
        return comps;
      };
      VMParent.prototype.onDestroy = function() {
        this.onUnBind();
        ViewModel_1.VM.remove(this.tag);
        this.data = null;
      };
      VMParent = __decorate([ ccclass, executionOrder(-1), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMParent.md") ], VMParent);
      return VMParent;
    }(cc.Component);
    exports.default = VMParent;
    cc._RF.pop();
  }, {
    "./ViewModel": "ViewModel"
  } ],
  VMProgress: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "2a50eqI7JZNV5Sh0y/Qd9C6", "VMProgress");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var VMCustom_1 = require("./VMCustom");
    var StringFormat_1 = require("./StringFormat");
    var Log_1 = require("../utils/Log");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, help = _a.help;
    var VMProgress = function(_super) {
      __extends(VMProgress, _super);
      function VMProgress() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.watchPathArr = [ "[min]", "[max]" ];
        _this.templateMode = true;
        _this.stringFormat = "";
        _this.isShowTweenAima = true;
        _this.aimaMinTime = .2;
        _this.aimaMaxTime = .5;
        return _this;
      }
      VMProgress.prototype.onLoad = function() {
        (this.watchPathArr.length < 2 || "[min]" == this.watchPathArr[0] || "[max]" == this.watchPathArr[1]) && console.error("VMProgress must have two values!");
        _super.prototype.onLoad.call(this);
      };
      VMProgress.prototype.start = function() {
        true;
        this.onValueInit();
      };
      VMProgress.prototype.onValueInit = function() {
        if (!this._watchComponent) {
          this._watchComponent = this.node.getComponent(this.componentName);
          this.checkComponentState();
        }
        var max = this.watchPathArr.length;
        for (var i = 0; i < max; i++) isNaN(this.watchPathArr[i]) ? this.templateValueArr[i] = this.VM.getValue(this.watchPathArr[i]) : this.templateValueArr[i] = Number(this.watchPathArr[i]);
        var value = this.templateValueArr[0] / this.templateValueArr[1];
        this.setComponentValue(value);
      };
      VMProgress.prototype.setComponentValue = function(value) {
        var _a;
        if ("" !== this.stringFormat) {
          var res = StringFormat_1.StringFormatFunction.deal(value, this.stringFormat);
          _super.prototype.setComponentValue.call(this, res);
        } else if (this.isShowTweenAima) if (value >= 1) {
          cc.director.getActionManager().removeAllActionsFromTarget(this._watchComponent, false);
          _super.prototype.setComponentValue.call(this, value);
        } else {
          var time = Math.abs(this._watchComponent[this.componentProperty] - value) * this.aimaMaxTime;
          time < this.aimaMinTime && (time = this.aimaMinTime);
          cc.director.getActionManager().removeAllActionsFromTarget(this._watchComponent, false);
          cc.tween(this._watchComponent).to(time, (_a = {}, _a[this.componentProperty] = value, 
          _a)).start();
        } else _super.prototype.setComponentValue.call(this, value);
      };
      VMProgress.prototype.onValueController = function(n, o) {
        var value = Math.round(n * this.templateValueArr[1]);
        isNaN(value) && (value = 0);
        this.VM.setValue(this.watchPathArr[0], value);
      };
      VMProgress.prototype.onValueChanged = function(n, o, pathArr) {
        if (false === this.templateMode) return;
        if (!this.watchPathArr) {
          Log_1.Log.log(Log_1.LOG_TAG.DEV, "111");
          return;
        }
        var path = pathArr.join(".");
        var index = this.watchPathArr.findIndex(function(v) {
          return v === path;
        });
        index >= 0 && (this.templateValueArr[index] = n);
        var value;
        if ("number" == typeof n) value = this.templateValueArr[0] / this.templateValueArr[1]; else {
          var a = this.templateValueArr[0];
          var b = this.templateValueArr[1];
          value = a.getRatio(b);
        }
        value > 1 && (value = 1);
        (value < 0 || isNaN(value)) && (value = 0);
        this.setComponentValue(value);
      };
      __decorate([ property({
        visible: false,
        override: true
      }) ], VMProgress.prototype, "watchPath", void 0);
      __decorate([ property({
        type: [ cc.String ],
        tooltip: "\u7b2c\u4e00\u4e2a\u503c\u662fmin \u503c\uff0c\u7b2c\u4e8c\u4e2a\u503c \u662f max \u503c\uff0c\u4f1a\u8ba1\u7b97\u51fa\u4e24\u8005\u7684\u6bd4\u4f8b"
      }) ], VMProgress.prototype, "watchPathArr", void 0);
      __decorate([ property({
        visible: function() {
          return "string" === this.componentProperty;
        },
        tooltip: "\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\uff0c\u548c VMLabel \u7684\u5b57\u6bb5\u4e00\u6837\uff0c\u9700\u8981\u586b\u5165\u5bf9\u5e94\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32"
      }) ], VMProgress.prototype, "stringFormat", void 0);
      __decorate([ property({
        tooltip: "\u8fdb\u5ea6\u6761\u7f13\u52a8\u53d8\u66f4"
      }) ], VMProgress.prototype, "isShowTweenAima", void 0);
      __decorate([ property({
        visible: function() {
          return this.isShowTweenAima;
        },
        tooltip: "\u7f13\u52a8\u6700\u77ed\u64ad\u653e\u65f6\u95f4"
      }) ], VMProgress.prototype, "aimaMinTime", void 0);
      __decorate([ property({
        visible: function() {
          return this.isShowTweenAima;
        },
        tooltip: "\u7f13\u52a8\u6700\u957f\u64ad\u653e\u65f6\u95f4"
      }) ], VMProgress.prototype, "aimaMaxTime", void 0);
      VMProgress = __decorate([ ccclass, menu("ModelViewer/VM-Progress (VM-\u8fdb\u5ea6\u6761)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMProgress.md") ], VMProgress);
      return VMProgress;
    }(VMCustom_1.default);
    exports.default = VMProgress;
    cc._RF.pop();
  }, {
    "../utils/Log": "Log",
    "./StringFormat": "StringFormat",
    "./VMCustom": "VMCustom"
  } ],
  VMState: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "47052uw/Y5O1LXaLObj4ARx", "VMState");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewModel_1 = require("./ViewModel");
    var VMBase_1 = require("./VMBase");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, menu = _a.menu, help = _a.help;
    var CONDITION;
    (function(CONDITION) {
      CONDITION[CONDITION["=="] = 0] = "==";
      CONDITION[CONDITION["!="] = 1] = "!=";
      CONDITION[CONDITION[">"] = 2] = ">";
      CONDITION[CONDITION[">="] = 3] = ">=";
      CONDITION[CONDITION["<"] = 4] = "<";
      CONDITION[CONDITION["<="] = 5] = "<=";
      CONDITION[CONDITION["range"] = 6] = "range";
    })(CONDITION || (CONDITION = {}));
    exports.VMSTATE_CONDITION = CONDITION;
    var ACTION;
    (function(ACTION) {
      ACTION[ACTION["NODE_ACTIVE"] = 0] = "NODE_ACTIVE";
      ACTION[ACTION["NODE_VISIBLE"] = 1] = "NODE_VISIBLE";
      ACTION[ACTION["NODE_OPACITY"] = 2] = "NODE_OPACITY";
      ACTION[ACTION["NODE_COLOR"] = 3] = "NODE_COLOR";
      ACTION[ACTION["COMPONENT_CUSTOM"] = 4] = "COMPONENT_CUSTOM";
    })(ACTION || (ACTION = {}));
    var CHILD_MODE_TYPE;
    (function(CHILD_MODE_TYPE) {
      CHILD_MODE_TYPE[CHILD_MODE_TYPE["NODE_INDEX"] = 0] = "NODE_INDEX";
      CHILD_MODE_TYPE[CHILD_MODE_TYPE["NODE_NAME"] = 1] = "NODE_NAME";
    })(CHILD_MODE_TYPE || (CHILD_MODE_TYPE = {}));
    var VMState = function(_super) {
      __extends(VMState, _super);
      function VMState() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.watchPath = "";
        _this.templateMode = false;
        _this.watchPathArr = [];
        _this.foreachChildMode = false;
        _this.condition = CONDITION["=="];
        _this.foreachChildType = CHILD_MODE_TYPE.NODE_INDEX;
        _this.valueA = 0;
        _this.valueB = 0;
        _this.valueAction = ACTION.NODE_ACTIVE;
        _this.valueActionOpacity = 0;
        _this.valueActionColor = cc.color(155, 155, 155);
        _this.valueComponentName = "";
        _this.valueComponentProperty = "";
        _this.valueComponentDefaultValue = "";
        _this.valueComponentActionValue = "";
        _this.watchNodes = [];
        return _this;
      }
      VMState.prototype.onLoad = function() {
        _super.prototype.onLoad.call(this);
        if (0 == this.watchNodes.length) {
          this.valueAction !== ACTION.NODE_ACTIVE && false === this.foreachChildMode && this.watchNodes.push(this.node);
          this.watchNodes = this.watchNodes.concat(this.node.children);
        }
      };
      VMState.prototype.start = function() {
        this.enabled && this.onValueInit();
      };
      VMState.prototype.onValueInit = function() {
        if (this.templateMode) {
          var max = this.watchPathArr.length;
          for (var i = 0; i < max; i++) this.templateValueArr[i] = this.VM.getValue(this.watchPathArr[i], "?");
          this.checkNodeFromValue(this.templateValueArr[0], this.templateValueArr[1]);
        } else {
          var value = ViewModel_1.VM.getValue(this.watchPath);
          this.checkNodeFromValue(value);
        }
      };
      VMState.prototype.onValueChanged = function(newVar, oldVar, pathArr) {
        if (false === this.templateMode) this.checkNodeFromValue(newVar); else {
          var path_1 = pathArr.join(".");
          var index = this.watchPathArr.findIndex(function(v) {
            return v === path_1;
          });
          index >= 0 && (this.templateValueArr[index] = newVar);
          if (0 == index) {
            var getValue = this.templateValueArr[1];
            this.checkNodeFromValue(newVar, getValue);
          } else if (1 == index) {
            var getValue = this.templateValueArr[0];
            this.checkNodeFromValue(getValue, newVar);
          }
        }
      };
      VMState.prototype.checkNodeFromValue = function(value, valueA) {
        var _this = this;
        if (this.foreachChildMode) this.watchNodes.forEach(function(node, index) {
          var v = _this.foreachChildType === CHILD_MODE_TYPE.NODE_INDEX ? index : node.name;
          var check = _this.conditionCheck(value, v);
          _this.setNodeState(node, check);
        }); else {
          var check = this.conditionCheck(value, null != valueA ? valueA : this.valueA, this.valueB);
          this.setNodesStates(check);
        }
      };
      VMState.prototype.setNodesStates = function(checkState) {
        var _this = this;
        var nodes = this.watchNodes;
        var check = checkState;
        nodes.forEach(function(node) {
          _this.setNodeState(node, check);
        });
      };
      VMState.prototype.setNodeState = function(node, checkState) {
        var n = this.valueAction;
        var check = checkState;
        var a = ACTION;
        switch (n) {
         case a.NODE_ACTIVE:
          node.active = !!check;
          break;

         case a.NODE_VISIBLE:
          node.opacity = check ? 255 : 0;
          break;

         case a.NODE_COLOR:
          node.color = check ? this.valueActionColor : cc.color(255, 255, 255);
          break;

         case a.NODE_OPACITY:
          node.opacity = check ? this.valueActionOpacity : 255;
          break;

         case a.COMPONENT_CUSTOM:
          var comp = node.getComponent(this.valueComponentName);
          if (null == comp) return;
          if (this.valueComponentProperty in comp) {
            var actionValue = this.valueComponentActionValue;
            var defaultVaulue = this.valueComponentDefaultValue;
            isNaN(actionValue) || (actionValue = Number(this.valueComponentActionValue));
            isNaN(defaultVaulue) || (defaultVaulue = Number(this.valueComponentDefaultValue));
            comp[this.valueComponentProperty] = check ? actionValue : defaultVaulue;
          }
        }
      };
      VMState.prototype.conditionCheck = function(v, a, b) {
        var cod = CONDITION;
        switch (this.condition) {
         case cod["=="]:
          if (v == a) return true;
          break;

         case cod["!="]:
          if (v != a) return true;
          break;

         case cod["<"]:
          if (v < a) return true;
          break;

         case cod[">"]:
          if (v > a) return true;
          break;

         case cod[">="]:
          if (v >= a) return true;
          break;

         case cod["<"]:
          if (v < a) return true;
          break;

         case cod["<="]:
          if (v <= a) return true;
          break;

         case cod["range"]:
          if (v >= a && v <= b) return true;
        }
        return false;
      };
      __decorate([ property({
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMState.prototype, "watchPath", void 0);
      __decorate([ property({
        displayName: "dynamicMode",
        tooltip: "\u662f\u5426\u662f2\u4e2a\u52a8\u6001\u503c"
      }) ], VMState.prototype, "templateMode", void 0);
      __decorate([ property({
        type: [ cc.String ],
        visible: function() {
          return true === this.templateMode;
        }
      }) ], VMState.prototype, "watchPathArr", void 0);
      __decorate([ property({
        tooltip: "\u904d\u5386\u5b50\u8282\u70b9,\u6839\u636e\u5b50\u8282\u70b9\u7684\u540d\u5b57\u6216\u540d\u5b57\u8f6c\u6362\u4e3a\u503c\uff0c\u5224\u65ad\u503c\u6ee1\u8db3\u6761\u4ef6 \u6765\u6fc0\u6d3b",
        visible: function() {
          return false === this.templateMode;
        }
      }) ], VMState.prototype, "foreachChildMode", void 0);
      __decorate([ property({
        type: cc.Enum(CONDITION)
      }) ], VMState.prototype, "condition", void 0);
      __decorate([ property({
        type: cc.Enum(CHILD_MODE_TYPE),
        tooltip: "\u904d\u5386\u5b50\u8282\u70b9,\u6839\u636e\u5b50\u8282\u70b9\u7684\u540d\u5b57\u8f6c\u6362\u4e3a\u503c\uff0c\u5224\u65ad\u503c\u6ee1\u8db3\u6761\u4ef6 \u6765\u6fc0\u6d3b",
        visible: function() {
          return true === this.foreachChildMode;
        }
      }) ], VMState.prototype, "foreachChildType", void 0);
      __decorate([ property({
        displayName: "Value: a",
        visible: function() {
          return false === this.foreachChildMode && false === this.templateMode;
        }
      }) ], VMState.prototype, "valueA", void 0);
      __decorate([ property({
        displayName: "Value: b",
        visible: function() {
          return false === this.foreachChildMode && false === this.templateMode && this.condition === CONDITION.range;
        }
      }) ], VMState.prototype, "valueB", void 0);
      __decorate([ property({
        type: cc.Enum(ACTION),
        tooltip: "\u4e00\u65e6\u6ee1\u8db3\u6761\u4ef6\u5c31\u5bf9\u8282\u70b9\u6267\u884c\u64cd\u4f5c"
      }) ], VMState.prototype, "valueAction", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.NODE_OPACITY;
        },
        range: [ 0, 255 ],
        type: cc.Integer,
        displayName: "Action Opacity"
      }) ], VMState.prototype, "valueActionOpacity", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.NODE_COLOR;
        },
        displayName: "Action Color"
      }) ], VMState.prototype, "valueActionColor", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.COMPONENT_CUSTOM;
        },
        displayName: "Component Name"
      }) ], VMState.prototype, "valueComponentName", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.COMPONENT_CUSTOM;
        },
        displayName: "Component Property"
      }) ], VMState.prototype, "valueComponentProperty", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.COMPONENT_CUSTOM;
        },
        displayName: "Default Value"
      }) ], VMState.prototype, "valueComponentDefaultValue", void 0);
      __decorate([ property({
        visible: function() {
          return this.valueAction === ACTION.COMPONENT_CUSTOM;
        },
        displayName: "Action Value"
      }) ], VMState.prototype, "valueComponentActionValue", void 0);
      __decorate([ property({
        type: [ cc.Node ],
        tooltip: "\u9700\u8981\u6267\u884c\u6761\u4ef6\u7684\u8282\u70b9\uff0c\u5982\u679c\u4e0d\u586b\u5199\u5219\u9ed8\u8ba4\u4f1a\u6267\u884c\u672c\u8282\u70b9\u4ee5\u53ca\u672c\u8282\u70b9\u7684\u6240\u6709\u5b50\u8282\u70b9 \u7684\u72b6\u6001"
      }) ], VMState.prototype, "watchNodes", void 0);
      VMState = __decorate([ ccclass, menu("ModelViewer/VM-State (VM\u72b6\u6001\u63a7\u5236)"), help("https://github.com/wsssheep/cocos_creator_mvvm_tools/blob/master/docs/VMState.md") ], VMState);
      return VMState;
    }(VMBase_1.default);
    exports.default = VMState;
    cc._RF.pop();
  }, {
    "./VMBase": "VMBase",
    "./ViewModel": "ViewModel"
  } ],
  ViewModel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "54f75k4X+RP0qaXOzrfZysL", "ViewModel");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var JsonOb_1 = require("./JsonOb");
    var VM_EMIT_HEAD = "VC:";
    var DEBUG_SHOW_PATH = false;
    function setValueFromPath(obj, path, value, tag) {
      void 0 === tag && (tag = "");
      var props = path.split(".");
      for (var i = 0; i < props.length; i++) {
        var propName = props[i];
        if (propName in obj === false) {
          console.error("[" + propName + "] not find in " + tag + "." + path);
          break;
        }
        i == props.length - 1 ? obj[propName] = value : obj = obj[propName];
      }
    }
    function getValueFromPath(obj, path, def, tag) {
      void 0 === tag && (tag = "");
      var props = path.split(".");
      for (var i = 0; i < props.length; i++) {
        var propName = props[i];
        if (propName in obj === false) {
          console.error("[" + propName + "] not find in " + tag + "." + path);
          return def;
        }
        obj = obj[propName];
      }
      null !== obj && "undefined" !== typeof obj || (obj = def);
      return obj;
    }
    var ViewModel = function() {
      function ViewModel(data, tag) {
        this._tag = null;
        this.active = true;
        this.emitToRootPath = false;
        new JsonOb_1.JsonOb(data, this._callback.bind(this));
        this.$data = data;
        this._tag = tag;
      }
      ViewModel.prototype._callback = function(n, o, path) {
        if (true == this.active) {
          var name = VM_EMIT_HEAD + this._tag + "." + path.join(".");
          DEBUG_SHOW_PATH && cc.log(">>", n, o, path);
          cc.director.emit(name, n, o, [ this._tag ].concat(path));
          this.emitToRootPath && cc.director.emit(VM_EMIT_HEAD + this._tag, n, o, path);
          if (path.length >= 2) {
            var parent = path.slice(0, path.length - 1);
            var value = this.getValue(parent.join("."));
            if ("object" == typeof value && "number" == typeof value.unit) {
              var name2 = VM_EMIT_HEAD + this._tag + "." + parent.join(".");
              cc.director.emit(name2, value, null, [ this._tag ].concat(parent));
            }
          }
        }
      };
      ViewModel.prototype.setValue = function(path, value) {
        setValueFromPath(this.$data, path, value, this._tag);
      };
      ViewModel.prototype.getValue = function(path, def) {
        return getValueFromPath(this.$data, path, def, this._tag);
      };
      return ViewModel;
    }();
    var VMManager = function() {
      function VMManager() {
        this._mvs = [];
        this.EMIT_HEAD = VM_EMIT_HEAD;
        this.setObjValue = setValueFromPath;
        this.getObjValue = getValueFromPath;
      }
      VMManager.prototype.add = function(data, tag, activeRootObject) {
        void 0 === tag && (tag = "global");
        void 0 === activeRootObject && (activeRootObject = false);
        var vm = new ViewModel(data, tag);
        var has = this._mvs.find(function(v) {
          return v.tag === tag;
        });
        if (tag.includes(".")) {
          console.error("cant write . in tag:", tag);
          return;
        }
        if (has) {
          console.error("already set VM tag:" + tag);
          return;
        }
        vm.emitToRootPath = activeRootObject;
        this._mvs.push({
          tag: tag,
          vm: vm
        });
      };
      VMManager.prototype.remove = function(tag) {
        var index = this._mvs.findIndex(function(v) {
          return v.tag === tag;
        });
        index >= 0 && this._mvs.splice(index, 1);
      };
      VMManager.prototype.get = function(tag) {
        var res = this._mvs.find(function(v) {
          return v.tag === tag;
        });
        if (null != res) return res.vm;
        console.error("cant find VM from:", tag);
      };
      VMManager.prototype.addValue = function(path, value) {
        path = path.trim();
        var rs = path.split(".");
        rs.length < 2 && console.error("Cant find path:" + path);
        var vm = this.get(rs[0]);
        if (!vm) {
          console.error("Cant Set VM:" + rs[0]);
          return;
        }
        var resPath = rs.slice(1).join(".");
        vm.setValue(resPath, vm.getValue(resPath) + value);
      };
      VMManager.prototype.getValue = function(path, def) {
        path = path.trim();
        var rs = path.split(".");
        if (rs.length < 2) {
          console.error("Get Value Cant find path:" + path);
          return;
        }
        var vm = this.get(rs[0]);
        if (!vm) {
          console.error("Cant Get VM:" + rs[0]);
          return;
        }
        return vm.getValue(rs.slice(1).join("."), def);
      };
      VMManager.prototype.setValue = function(path, value) {
        path = path.trim();
        var rs = path.split(".");
        if (rs.length < 2) {
          console.error("Set Value Cant find path:" + path);
          return;
        }
        var vm = this.get(rs[0]);
        if (!vm) {
          console.error("Cant Set VM:" + rs[0]);
          return;
        }
        vm.setValue(rs.slice(1).join("."), value);
      };
      VMManager.prototype.bindPath = function(path, callback, target, useCapture) {
        path = path.trim();
        if ("" == path) {
          console.error(target.node.name, "\u8282\u70b9\u7ed1\u5b9a\u7684\u8def\u5f84\u4e3a\u7a7a");
          return;
        }
        if ("*" === path.split(".")[0]) {
          console.error(path, "\u8def\u5f84\u4e0d\u5408\u6cd5,\u53ef\u80fd\u9519\u8bef\u8986\u76d6\u4e86 VMParent \u7684onLoad \u65b9\u6cd5, \u6216\u8005\u7236\u8282\u70b9\u5e76\u672a\u6302\u8f7d VMParent \u76f8\u5173\u7684\u7ec4\u4ef6\u811a\u672c");
          return;
        }
        cc.director.on(VM_EMIT_HEAD + path, callback, target, useCapture);
      };
      VMManager.prototype.unbindPath = function(path, callback, target) {
        path = path.trim();
        if ("*" === path.split(".")[0]) {
          console.error(path, "\u8def\u5f84\u4e0d\u5408\u6cd5,\u53ef\u80fd\u9519\u8bef\u8986\u76d6\u4e86 VMParent \u7684onLoad \u65b9\u6cd5, \u6216\u8005\u7236\u8282\u70b9\u5e76\u672a\u6302\u8f7d VMParent \u76f8\u5173\u7684\u7ec4\u4ef6\u811a\u672c");
          return;
        }
        cc.director.off(VM_EMIT_HEAD + path, callback, target);
      };
      VMManager.prototype.inactive = function() {
        this._mvs.forEach(function(mv) {
          mv.vm.active = false;
        });
      };
      VMManager.prototype.active = function() {
        this._mvs.forEach(function(mv) {
          mv.vm.active = true;
        });
      };
      VMManager.prototype.clear = function() {
        this._mvs = [];
      };
      return VMManager;
    }();
    exports.VM = new VMManager();
    cc._RF.pop();
  }, {
    "./JsonOb": "JsonOb"
  } ],
  ViewZOrder: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "026f09EFxlJc7qY4jXhS5L1", "ViewZOrder");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ViewZorder = function() {
      function ViewZorder() {}
      ViewZorder.Scene = 20;
      ViewZorder.MenuPanel = 80;
      ViewZorder.UI = 100;
      ViewZorder.Dialog = 200;
      ViewZorder.Tips = 300;
      ViewZorder.Guide = 400;
      ViewZorder.Notice = 500;
      ViewZorder.Loading = 600;
      return ViewZorder;
    }();
    exports.ViewZorder = ViewZorder;
    cc._RF.pop();
  }, {} ],
  WXGameTopBarUIAdapter: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f34d0o78FBNvIsYiZX0BNyl", "WXGameTopBarUIAdapter");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var WXGameTopBarUIAdapter = function(_super) {
      __extends(WXGameTopBarUIAdapter, _super);
      function WXGameTopBarUIAdapter() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      WXGameTopBarUIAdapter.prototype.start = function() {
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
          var menuInfo = wx.getMenuButtonBoundingClientRect();
          var systemInfo = wx.getSystemInfoSync();
          var paddingTop = this.node.parent.height * (menuInfo.top / systemInfo.screenHeight);
          this.node.height = this.node.parent.height * (menuInfo.height / systemInfo.screenHeight);
          var widget = this.node.getComponent(cc.Widget);
          widget.top = paddingTop;
          widget.isAbsoluteTop = true;
          widget.isAlignTop = true;
          widget.updateAlignment();
        }
      };
      WXGameTopBarUIAdapter = __decorate([ ccclass ], WXGameTopBarUIAdapter);
      return WXGameTopBarUIAdapter;
    }(cc.Component);
    exports.default = WXGameTopBarUIAdapter;
    cc._RF.pop();
  }, {} ],
  WxCloudMng: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "0215fBuvedJMow/R4FrgIVN", "WxCloudMng");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var DataUtil_1 = require("../main/utils/DataUtil");
    var AudioMng_1 = require("./AudioMng");
    var GameDataCenter_1 = require("../../data/GameDataCenter");
    var Log_1 = require("../main/utils/Log");
    var UIHelp_1 = require("../main/ui/UIHelp");
    var UIDetailTip_1 = require("../../main/ui/tips/UIDetailTip");
    var INFO = {
      SCOPE: {
        USER_INFO: "scope.userInfo",
        USER_LOCATION: "scope.userLocation",
        WERUN: "scope.werun",
        RECORD: "scope.record",
        WRITE_PHOTOS_ALBUM: "scope.writePhotosAlbum"
      },
      APPID: "",
      OFFERID: "",
      GAME_NAME: "maoXianZhen",
      AdUnitId: "adunit-7f4458fe4de1ad79",
      AdUnitIdShort: "adunit-a717d7460d376687"
    };
    var WxCloudMng = function() {
      function WxCloudMng() {
        this.lastUploadDate = {};
        this.query = null;
        this.shareStartTime = 0;
      }
      WxCloudMng.prototype.initWx = function() {
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
          wx.onShow(function() {
            AudioMng_1.default.resumeBGM();
          });
          wx.onHide(function() {
            GameDataCenter_1.default.account.Save();
            Log_1.Log.log("\u9000\u540e\u53f0\u4fdd\u5b58\u6570\u636e");
          });
          this.creatVideoAD();
        }
      };
      WxCloudMng.prototype.getUserInfo = function() {
        return wx.cloud.callFunction({
          name: "login"
        });
      };
      WxCloudMng.prototype.uploadData = function(data) {
        var _this = this;
        var newdata = DataUtil_1.default.dataClean(data, this.lastUploadDate);
        var copy = DataUtil_1.default.deepCopy(data);
        Object.keys(copy).forEach(function(key) {
          _this.lastUploadDate[key] = copy[key];
        });
        return wx.cloud.callFunction({
          name: "uploadScore",
          data: {
            newdata: newdata
          }
        });
      };
      WxCloudMng.prototype.getPlayerData = function() {
        return wx.cloud.callFunction({
          name: "getPlayerData"
        });
      };
      WxCloudMng.prototype.getServerTime = function() {
        return wx.cloud.callFunction({
          name: "getServerTime"
        });
      };
      WxCloudMng.prototype.getWorldRankData = function() {
        return wx.cloud.callFunction({
          name: "getWorldRankData"
        });
      };
      WxCloudMng.prototype.playVideoAd = function(succFunc, failFunc, cancelFunc, isLong) {
        this.videoTime = 0;
        this.videoSuccFunc = succFunc;
        this.videoFailFunc = failFunc;
        this.videoCancelFunc = cancelFunc;
        this.showVideo(isLong);
      };
      WxCloudMng.prototype.creatVideoAD = function() {
        var _this = this;
        if (cc.sys.platform != cc.sys.WECHAT_GAME || "" == INFO.AdUnitId) return;
        var self = this;
        this.videoAd = wx.createRewardedVideoAd({
          adUnitId: INFO.AdUnitId
        });
        this.videoAdShort = wx.createRewardedVideoAd({
          adUnitId: INFO.AdUnitIdShort
        });
        this.videoAd.onError(function(err) {
          console.info("showVideoAD err:", err.errMsg);
          if (1004 == err.errCode) {
            self.videoAdShowing = false;
            errorHandel(err.errCode);
          } else {
            _this.videoTime++;
            if (_this.videoTime >= 3) {
              self.videoAdShowing = false;
              errorHandel(err.errCode);
            } else self.showVideo();
          }
        });
        function errorHandel(errCode) {
          cc.log("[WeiXinManager] errorHandel:", errCode);
          self.videoFailFunc && self.videoFailFunc();
        }
        this.videoAd.onClose(function(res) {
          _this.videoAdShowing = false;
          res && res.isEnded || void 0 === res ? _this.videoSuccFunc && _this.videoSuccFunc() : _this.videoCancelFunc && _this.videoCancelFunc();
        });
      };
      WxCloudMng.prototype.showVideo = function(isLong) {
        var _this = this;
        isLong ? this.videoAd.load().then(function() {
          _this.videoAdShowing = true;
          _this.videoAd.show();
        }) : this.videoAdShort.load().then(function() {
          _this.videoAdShowing = true;
          _this.videoAd.show();
        });
      };
      WxCloudMng.prototype.createGameClub = function(node) {
        var size = this.getDeviceSizeByNode2(node);
        this.gameClubBtn = wx.createGameClubButton({
          type: "image",
          style: {
            left: size.x,
            top: size.y,
            width: size.width,
            height: size.height
          },
          icon: "light"
        });
      };
      WxCloudMng.prototype.showGameClub = function() {
        cc.sys.platform === cc.sys.WECHAT_GAME && this.gameClubBtn && this.gameClubBtn.show();
      };
      WxCloudMng.prototype.hideGameClub = function() {
        cc.sys.platform === cc.sys.WECHAT_GAME && this.gameClubBtn && this.gameClubBtn.hide();
      };
      WxCloudMng.prototype.wxOnShow = function() {
        if (this.isSharing) {
          var self = this;
          var data = cc.sys.localStorage.getItem("click_share_data");
          if (null != data && "" != data) {
            data = JSON.parse(data);
            var todayTxt = new Date(1e3 * DataUtil_1.default.getNowDateStemp()).toDateString();
            if (data.date !== todayTxt) {
              data.date = todayTxt;
              data.num = 1;
            }
          } else data = {
            date: new Date(1e3 * DataUtil_1.default.getNowDateStemp()).toDateString(),
            num: 1
          };
          if (1 != data.num && 5 != data.num && 9 != data.num && 14 != data.num && 18 != data.num && 24 != data.num && 30 != data.num && 35 != data.num || !data.showShare) {
            data.showShare = true;
            var nowTime = new Date().getTime();
            var deltaTime = nowTime - self.shareStartTime;
            var flagTime = void 0;
            flagTime = data.num < 4 ? 2e3 : data.num < 8 ? 3e3 : 4e3;
            if (deltaTime < flagTime) this.shareCancelFunc && this.shareCancelFunc(); else {
              data.num++;
              self.shareSuccFunc();
              self.shareSuccFunc = null;
            }
          } else {
            data.showShare = false;
            this.shareCancelFunc && this.shareCancelFunc();
          }
          cc.sys.localStorage.setItem("click_share_data", JSON.stringify(data));
          this.isSharing = false;
        }
      };
      WxCloudMng.prototype.jumpToOtherApp = function(appId, path) {
        void 0 === path && (path = "");
        wx.navigateToMiniProgram({
          appId: appId,
          path: path,
          extraData: {},
          envVersion: "release",
          success: function(res) {
            cc.log("-------\u6253\u5f00\u6210\u529f------", res);
          },
          fail: function(res) {
            cc.log("-------\u6253\u5f00\u5931\u8d25------", res);
          }
        });
      };
      WxCloudMng.prototype.showKefu = function(showCard, title, imgUrl, succFunc) {
        void 0 === showCard && (showCard = false);
        void 0 === title && (title = "");
        void 0 === imgUrl && (imgUrl = "");
        void 0 === succFunc && (succFunc = function() {});
        wx.openCustomerServiceConversation({
          sessionFrom: INFO.GAME_NAME,
          showMessageCard: showCard,
          sendMessageTitle: title,
          sendMessageImg: imgUrl,
          success: function(res) {
            succFunc && succFunc();
            cc.log("openCustomerServiceConversation success", res);
          },
          fail: function(err) {
            cc.log("openCustomerServiceConversation err", err);
          }
        });
      };
      WxCloudMng.prototype.contactService = function() {
        cc.sys.platform == cc.sys.WECHAT_GAME && wx.openCustomerServiceConversation({
          sessionFrom: INFO.GAME_NAME
        });
      };
      WxCloudMng.prototype.getLaunchData = function() {
        var launchInfo = wx.getLaunchOptionsSync();
        cc.log("[WxManager] getLaunchData:", launchInfo);
        return launchInfo;
      };
      WxCloudMng.prototype.showShareMenu = function(isWithShareTicket) {
        wx.showShareMenu({
          withShareTicket: isWithShareTicket,
          success: function(res) {
            cc.log("show share menu success" + res);
            wx.onShareAppMessage(function() {
              return {
                title: "\u8d85\u597d\u73a9\uff0c\u901f\u6765!",
                imageUrl: ""
              };
            });
          },
          fail: function() {
            cc.log("show share menu fail");
          },
          complete: function(res) {
            cc.log("show share menu complete");
          }
        });
      };
      WxCloudMng.prototype.shareImgMessage = function(_title, size, _query, shareSuccFunc, shareCancelFunc) {
        void 0 === size && (size = {});
        void 0 === _query && (_query = "");
        void 0 === shareSuccFunc && (shareSuccFunc = null);
        void 0 === shareCancelFunc && (shareCancelFunc = null);
        if (this.isSharing) return;
        this.isSharing = true;
        this.shareSuccFunc = shareSuccFunc;
        this.shareCancelFunc = shareCancelFunc;
        this.shareStartTime = new Date().getTime();
        if (size.hasOwnProperty("x")) cc.game.canvas.toTempFilePath({
          x: size.x,
          y: size.y,
          width: size.width,
          height: size.height,
          destWidth: size.width,
          destHeight: size.height,
          success: function(res) {
            wx.shareAppMessage({
              title: _title,
              imageUrl: res.tempFilePath,
              query: _query
            });
          }
        }); else {
          var realWidth = 600;
          var viSize = cc.view.getVisibleSize();
          cc.game.canvas.toTempFilePath({
            x: 0,
            y: 0,
            width: viSize.width,
            height: viSize.height,
            destWidth: realWidth,
            destHeight: realWidth / viSize.width * viSize.height,
            success: function(res) {
              wx.shareAppMessage({
                title: _title,
                imageUrl: res.tempFilePath,
                query: _query
              });
            }
          });
        }
      };
      WxCloudMng.prototype.shareMessage = function(_title, _imageUrl, _query, shareSucceedCallback, shareCancelFunc) {
        void 0 === _query && (_query = "");
        void 0 === shareSucceedCallback && (shareSucceedCallback = null);
        void 0 === shareCancelFunc && (shareCancelFunc = null);
        if (this.isSharing) return;
        this.isSharing = true;
        this.shareSuccFunc = shareSucceedCallback;
        this.shareCancelFunc = shareCancelFunc;
        this.shareStartTime = new Date().getTime();
        wx.shareAppMessage({
          title: _title,
          imageUrl: _imageUrl,
          query: _query
        });
      };
      WxCloudMng.prototype.shareAppImgMessage = function(title, node, succ, cancel) {
        void 0 === succ && (succ = null);
        void 0 === cancel && (cancel = null);
        var size = this.getDeviceSizeByNode(node);
        var query = "";
        this.shareImgMessage(title, size, query, succ, cancel);
      };
      WxCloudMng.prototype.getDeviceSizeByNode = function(node) {
        var size = {
          x: 0,
          y: 0,
          width: 0,
          height: 0
        };
        if ("cc.Node" == cc.js.getClassName(node)) {
          var sysInfo = wx.getSystemInfoSync();
          var rect = node.getBoundingBoxToWorld();
          var ratio = cc.view._devicePixelRatio;
          var scale = cc.view.getScaleX();
          var factor = scale / ratio;
          size = {
            x: rect.x * factor * ratio,
            y: (sysInfo.screenHeight - (rect.y + rect.height) * factor) * ratio,
            width: rect.width * factor * ratio,
            height: rect.height * factor * ratio
          };
        }
        return size;
      };
      WxCloudMng.prototype.getDeviceSizeByNode2 = function(node) {
        var size = {
          x: 0,
          y: 0,
          width: 0,
          height: 0
        };
        if ("cc.Node" == cc.js.getClassName(node)) {
          var sysInfo = wx.getSystemInfoSync();
          var rect = node.getBoundingBoxToWorld();
          var ratio = cc.view._devicePixelRatio;
          var scale = cc.view.getScaleX();
          var factor = scale / ratio;
          size = {
            x: rect.x * factor,
            y: sysInfo.screenHeight - (rect.y + rect.height) * factor,
            width: rect.width * factor,
            height: rect.height * factor
          };
          var posx = (sysInfo.screenWidth / sysInfo.screenHeight > 2 ? .25 : 0) * size.width;
          size.x += posx;
        }
        return size;
      };
      WxCloudMng.prototype.postQuery = function(query) {
        (query.hasOwnProperty("uid") || query.hasOwnProperty("scene")) && query.hasOwnProperty("scene") && (query.scene = decodeURIComponent(query.scene));
      };
      WxCloudMng.prototype.questAuthorize = function(callFunc) {
        var self = this;
        wx.getSetting({
          success: function(res) {
            if (res.authSetting[INFO.SCOPE.USER_INFO]) callFunc && callFunc(); else {
              var btn_1;
              var option = {
                title: "\u63d0\u793a",
                content: "\u67e5\u770b\u6392\u884c\u699c\u9700\u8981\u83b7\u53d6\u60a8\u7684\u5934\u50cf\u3001\u540d\u79f0,\n\u662f\u5426\u6388\u6743\uff1f",
                cancelCb: function() {},
                certainCb: function() {},
                cancelTxt: "\u786e\u8ba4\u6388\u6743",
                certainTxt: "\u53d6\u6d88"
              };
              UIHelp_1.default.ShowDetailTip(option, function(uiView) {
                uiView.scheduleOnce(function() {
                  var size = self.getDeviceSizeByNode2(uiView.ui.Common_Button_Cancel);
                  btn_1 = wx.createUserInfoButton({
                    type: "text",
                    text: "",
                    withCredentials: false,
                    style: {
                      left: size.x + size.width / 2,
                      top: size.y,
                      width: size.width,
                      height: size.height,
                      lineHeight: 0,
                      backgroundColor: "",
                      color: "#ffffff",
                      textAlign: "center",
                      fontSize: 16,
                      borderRadius: 4
                    }
                  });
                  btn_1.show();
                  uiView.onClickCancel = function() {};
                  uiView.onClose = function() {
                    btn_1 && btn_1.destroy();
                    UIHelp_1.default.CloseUI(UIDetailTip_1.default);
                  };
                  uiView.setCanTouchClose();
                  btn_1.onTap(function(res) {
                    cc.log(res);
                    if (!res.userInfo) return;
                    var localData = GameDataCenter_1.default.account.getLocalData();
                    localData.name = res.userInfo.nickName;
                    localData.imgUrl = res.userInfo.avatarUrl;
                    GameDataCenter_1.default.account.saveNum = 99;
                    GameDataCenter_1.default.account.Save();
                    uiView.onClose();
                    callFunc && callFunc();
                  });
                }, .5);
              });
            }
          }
        });
      };
      return WxCloudMng;
    }();
    exports.default = new WxCloudMng();
    cc._RF.pop();
  }, {
    "../../data/GameDataCenter": "GameDataCenter",
    "../../main/ui/tips/UIDetailTip": "UIDetailTip",
    "../main/ui/UIHelp": "UIHelp",
    "../main/utils/DataUtil": "DataUtil",
    "../main/utils/Log": "Log",
    "./AudioMng": "AudioMng"
  } ],
  async: [ function(require, module, exports) {
    (function(process, global) {
      "use strict";
      cc._RF.push(module, "ee6d80p2GFGVpRr0GCveod+", "async");
      "use strict";
      function _typeof(obj) {
        "@babel/helpers - typeof";
        _typeof = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function _typeof(obj) {
          return typeof obj;
        } : function _typeof(obj) {
          return obj && "function" === typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
        return _typeof(obj);
      }
      !function(n, t) {
        "object" == ("undefined" === typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define([ "exports" ], t) : t(n.async = n.async || {});
      }(void 0, function(n) {
        function t(n, t) {
          t |= 0;
          for (var e = Math.max(n.length - t, 0), r = Array(e), u = 0; u < e; u++) r[u] = n[t + u];
          return r;
        }
        function e(n) {
          var t = _typeof(n);
          return null != n && ("object" == t || "function" == t);
        }
        function r(n) {
          setTimeout(n, 0);
        }
        function u(n) {
          return function(e) {
            var r = t(arguments, 1);
            n(function() {
              e.apply(null, r);
            });
          };
        }
        function i(n) {
          return ct(function(t, r) {
            var u;
            try {
              u = n.apply(this, t);
            } catch (n) {
              return r(n);
            }
            e(u) && "function" == typeof u.then ? u.then(function(n) {
              o(r, null, n);
            }, function(n) {
              o(r, n.message ? n : new Error(n));
            }) : r(null, u);
          });
        }
        function o(n, t, e) {
          try {
            n(t, e);
          } catch (n) {
            lt(c, n);
          }
        }
        function c(n) {
          throw n;
        }
        function f(n) {
          return st && "AsyncFunction" === n[Symbol.toStringTag];
        }
        function a(n) {
          return f(n) ? i(n) : n;
        }
        function l(n) {
          return function(e) {
            var r = t(arguments, 1), u = ct(function(t, r) {
              var u = this;
              return n(e, function(n, e) {
                a(n).apply(u, t.concat(e));
              }, r);
            });
            return r.length ? u.apply(this, r) : u;
          };
        }
        function s(n) {
          var t = mt.call(n, bt), e = n[bt];
          try {
            n[bt] = void 0;
            var r = !0;
          } catch (n) {}
          var u = gt.call(n);
          return r && (t ? n[bt] = e : delete n[bt]), u;
        }
        function p(n) {
          return St.call(n);
        }
        function h(n) {
          return null == n ? void 0 === n ? Lt : kt : Ot && Ot in Object(n) ? s(n) : p(n);
        }
        function y(n) {
          if (!e(n)) return !1;
          var t = h(n);
          return t == xt || t == Et || t == wt || t == At;
        }
        function v(n) {
          return "number" == typeof n && n > -1 && n % 1 == 0 && n <= Tt;
        }
        function d(n) {
          return null != n && v(n.length) && !y(n);
        }
        function m() {}
        function g(n) {
          return function() {
            if (null !== n) {
              var t = n;
              n = null, t.apply(this, arguments);
            }
          };
        }
        function b(n, t) {
          for (var e = -1, r = Array(n); ++e < n; ) r[e] = t(e);
          return r;
        }
        function j(n) {
          return null != n && "object" == _typeof(n);
        }
        function S(n) {
          return j(n) && h(n) == _t;
        }
        function k() {
          return !1;
        }
        function L(n, t) {
          return t = null == t ? Nt : t, !!t && ("number" == typeof n || Qt.test(n)) && n > -1 && n % 1 == 0 && n < t;
        }
        function O(n) {
          return j(n) && v(n.length) && !!me[h(n)];
        }
        function w(n) {
          return function(t) {
            return n(t);
          };
        }
        function x(n, t) {
          var e = Vt(n), r = !e && Pt(n), u = !e && !r && Wt(n), i = !e && !r && !u && Oe(n), o = e || r || u || i, c = o ? b(n.length, String) : [], f = c.length;
          for (var a in n) !t && !xe.call(n, a) || o && ("length" == a || u && ("offset" == a || "parent" == a) || i && ("buffer" == a || "byteLength" == a || "byteOffset" == a) || L(a, f)) || c.push(a);
          return c;
        }
        function E(n) {
          var t = n && n.constructor, e = "function" == typeof t && t.prototype || Ee;
          return n === e;
        }
        function A(n, t) {
          return function(e) {
            return n(t(e));
          };
        }
        function T(n) {
          if (!E(n)) return Ae(n);
          var t = [];
          for (var e in Object(n)) Be.call(n, e) && "constructor" != e && t.push(e);
          return t;
        }
        function B(n) {
          return d(n) ? x(n) : T(n);
        }
        function F(n) {
          var t = -1, e = n.length;
          return function() {
            return ++t < e ? {
              value: n[t],
              key: t
            } : null;
          };
        }
        function I(n) {
          var t = -1;
          return function() {
            var e = n.next();
            return e.done ? null : (t++, {
              value: e.value,
              key: t
            });
          };
        }
        function _(n) {
          var t = B(n), e = -1, r = t.length;
          return function() {
            var u = t[++e];
            return e < r ? {
              value: n[u],
              key: u
            } : null;
          };
        }
        function M(n) {
          if (d(n)) return F(n);
          var t = It(n);
          return t ? I(t) : _(n);
        }
        function U(n) {
          return function() {
            if (null === n) throw new Error("Callback was already called.");
            var t = n;
            n = null, t.apply(this, arguments);
          };
        }
        function z(n) {
          return function(t, e, r) {
            function u(n, t) {
              if (f -= 1, n) c = !0, r(n); else {
                if (t === Bt || c && f <= 0) return c = !0, r(null);
                i();
              }
            }
            function i() {
              for (;f < n && !c; ) {
                var t = o();
                if (null === t) return c = !0, void (f <= 0 && r(null));
                f += 1, e(t.value, t.key, U(u));
              }
            }
            if (r = g(r || m), n <= 0 || !t) return r(null);
            var o = M(t), c = !1, f = 0;
            i();
          };
        }
        function P(n, t, e, r) {
          z(t)(n, a(e), r);
        }
        function V(n, t) {
          return function(e, r, u) {
            return n(e, t, r, u);
          };
        }
        function q(n, t, e) {
          function r(n, t) {
            n ? e(n) : ++i !== o && t !== Bt || e(null);
          }
          e = g(e || m);
          var u = 0, i = 0, o = n.length;
          for (0 === o && e(null); u < o; u++) t(n[u], u, U(r));
        }
        function D(n) {
          return function(t, e, r) {
            return n(Ie, t, a(e), r);
          };
        }
        function R(n, t, e, r) {
          r = r || m, t = t || [];
          var u = [], i = 0, o = a(e);
          n(t, function(n, t, e) {
            var r = i++;
            o(n, function(n, t) {
              u[r] = t, e(n);
            });
          }, function(n) {
            r(n, u);
          });
        }
        function C(n) {
          return function(t, e, r, u) {
            return n(z(e), t, a(r), u);
          };
        }
        function $(n, t) {
          for (var e = -1, r = null == n ? 0 : n.length; ++e < r && !1 !== t(n[e], e, n); ) ;
          return n;
        }
        function W(n) {
          return function(t, e, r) {
            for (var u = -1, i = Object(t), o = r(t), c = o.length; c--; ) {
              var f = o[n ? c : ++u];
              if (!1 === e(i[f], f, i)) break;
            }
            return t;
          };
        }
        function N(n, t) {
          return n && Ve(n, t, B);
        }
        function Q(n, t, e, r) {
          for (var u = n.length, i = e + (r ? 1 : -1); r ? i-- : ++i < u; ) if (t(n[i], i, n)) return i;
          return -1;
        }
        function G(n) {
          return n !== n;
        }
        function H(n, t, e) {
          for (var r = e - 1, u = n.length; ++r < u; ) if (n[r] === t) return r;
          return -1;
        }
        function J(n, t, e) {
          return t === t ? H(n, t, e) : Q(n, G, e);
        }
        function K(n, t) {
          for (var e = -1, r = null == n ? 0 : n.length, u = Array(r); ++e < r; ) u[e] = t(n[e], e, n);
          return u;
        }
        function X(n) {
          return "symbol" == _typeof(n) || j(n) && h(n) == De;
        }
        function Y(n) {
          if ("string" == typeof n) return n;
          if (Vt(n)) return K(n, Y) + "";
          if (X(n)) return $e ? $e.call(n) : "";
          var t = n + "";
          return "0" == t && 1 / n == -Re ? "-0" : t;
        }
        function Z(n, t, e) {
          var r = -1, u = n.length;
          t < 0 && (t = -t > u ? 0 : u + t), e = e > u ? u : e, e < 0 && (e += u), u = t > e ? 0 : e - t >>> 0, 
          t >>>= 0;
          for (var i = Array(u); ++r < u; ) i[r] = n[r + t];
          return i;
        }
        function nn(n, t, e) {
          var r = n.length;
          return e = void 0 === e ? r : e, !t && e >= r ? n : Z(n, t, e);
        }
        function tn(n, t) {
          for (var e = n.length; e-- && J(t, n[e], 0) > -1; ) ;
          return e;
        }
        function en(n, t) {
          for (var e = -1, r = n.length; ++e < r && J(t, n[e], 0) > -1; ) ;
          return e;
        }
        function rn(n) {
          return n.split("");
        }
        function un(n) {
          return Xe.test(n);
        }
        function on(n) {
          return n.match(mr) || [];
        }
        function cn(n) {
          return un(n) ? on(n) : rn(n);
        }
        function fn(n) {
          return null == n ? "" : Y(n);
        }
        function an(n, t, e) {
          if (n = fn(n), n && (e || void 0 === t)) return n.replace(gr, "");
          if (!n || !(t = Y(t))) return n;
          var r = cn(n), u = cn(t), i = en(r, u), o = tn(r, u) + 1;
          return nn(r, i, o).join("");
        }
        function ln(n) {
          return n = n.toString().replace(kr, ""), n = n.match(br)[2].replace(" ", ""), n = n ? n.split(jr) : [], 
          n.map(function(n) {
            return an(n.replace(Sr, ""));
          });
        }
        function sn(n, t) {
          var e = {};
          N(n, function(n, t) {
            function r(t, e) {
              var r = K(u, function(n) {
                return t[n];
              });
              r.push(e), a(n).apply(null, r);
            }
            var u, i = f(n), o = !i && 1 === n.length || i && 0 === n.length;
            if (Vt(n)) u = n.slice(0, -1), n = n[n.length - 1], e[t] = u.concat(u.length > 0 ? r : n); else if (o) e[t] = n; else {
              if (u = ln(n), 0 === n.length && !i && 0 === u.length) throw new Error("autoInject task functions require explicit parameters.");
              i || u.pop(), e[t] = u.concat(r);
            }
          }), qe(e, t);
        }
        function pn() {
          this.head = this.tail = null, this.length = 0;
        }
        function hn(n, t) {
          n.length = 1, n.head = n.tail = t;
        }
        function yn(n, t, e) {
          function r(n, t, e) {
            if (null != e && "function" != typeof e) throw new Error("task callback must be a function");
            if (s.started = !0, Vt(n) || (n = [ n ]), 0 === n.length && s.idle()) return lt(function() {
              s.drain();
            });
            for (var r = 0, u = n.length; r < u; r++) {
              var i = {
                data: n[r],
                callback: e || m
              };
              t ? s._tasks.unshift(i) : s._tasks.push(i);
            }
            f || (f = !0, lt(function() {
              f = !1, s.process();
            }));
          }
          function u(n) {
            return function(t) {
              o -= 1;
              for (var e = 0, r = n.length; e < r; e++) {
                var u = n[e], i = J(c, u, 0);
                0 === i ? c.shift() : i > 0 && c.splice(i, 1), u.callback.apply(u, arguments), null != t && s.error(t, u.data);
              }
              o <= s.concurrency - s.buffer && s.unsaturated(), s.idle() && s.drain(), s.process();
            };
          }
          if (null == t) t = 1; else if (0 === t) throw new Error("Concurrency must not be zero");
          var i = a(n), o = 0, c = [], f = !1, l = !1, s = {
            _tasks: new pn(),
            concurrency: t,
            payload: e,
            saturated: m,
            unsaturated: m,
            buffer: t / 4,
            empty: m,
            drain: m,
            error: m,
            started: !1,
            paused: !1,
            push: function push(n, t) {
              r(n, !1, t);
            },
            kill: function kill() {
              s.drain = m, s._tasks.empty();
            },
            unshift: function unshift(n, t) {
              r(n, !0, t);
            },
            remove: function remove(n) {
              s._tasks.remove(n);
            },
            process: function process() {
              if (!l) {
                for (l = !0; !s.paused && o < s.concurrency && s._tasks.length; ) {
                  var n = [], t = [], e = s._tasks.length;
                  s.payload && (e = Math.min(e, s.payload));
                  for (var r = 0; r < e; r++) {
                    var f = s._tasks.shift();
                    n.push(f), c.push(f), t.push(f.data);
                  }
                  o += 1, 0 === s._tasks.length && s.empty(), o === s.concurrency && s.saturated();
                  var a = U(u(n));
                  i(t, a);
                }
                l = !1;
              }
            },
            length: function length() {
              return s._tasks.length;
            },
            running: function running() {
              return o;
            },
            workersList: function workersList() {
              return c;
            },
            idle: function idle() {
              return s._tasks.length + o === 0;
            },
            pause: function pause() {
              s.paused = !0;
            },
            resume: function resume() {
              !1 !== s.paused && (s.paused = !1, lt(s.process));
            }
          };
          return s;
        }
        function vn(n, t) {
          return yn(n, 1, t);
        }
        function dn(n, t, e, r) {
          r = g(r || m);
          var u = a(e);
          Or(n, function(n, e, r) {
            u(t, n, function(n, e) {
              t = e, r(n);
            });
          }, function(n) {
            r(n, t);
          });
        }
        function mn() {
          var n = K(arguments, a);
          return function() {
            var e = t(arguments), r = this, u = e[e.length - 1];
            "function" == typeof u ? e.pop() : u = m, dn(n, e, function(n, e, u) {
              e.apply(r, n.concat(function(n) {
                var e = t(arguments, 1);
                u(n, e);
              }));
            }, function(n, t) {
              u.apply(r, [ n ].concat(t));
            });
          };
        }
        function gn(n) {
          return n;
        }
        function bn(n, t) {
          return function(e, r, u, i) {
            i = i || m;
            var o, c = !1;
            e(r, function(e, r, i) {
              u(e, function(r, u) {
                r ? i(r) : n(u) && !o ? (c = !0, o = t(!0, e), i(null, Bt)) : i();
              });
            }, function(n) {
              n ? i(n) : i(null, c ? o : t(!1));
            });
          };
        }
        function jn(n, t) {
          return t;
        }
        function Sn(n) {
          return function(e) {
            var r = t(arguments, 1);
            r.push(function(e) {
              var r = t(arguments, 1);
              "object" == ("undefined" === typeof console ? "undefined" : _typeof(console)) && (e ? console.error && console.error(e) : console[n] && $(r, function(t) {
                console[n](t);
              }));
            }), a(e).apply(null, r);
          };
        }
        function kn(n, e, r) {
          function u(n) {
            if (n) return r(n);
            var e = t(arguments, 1);
            e.push(i), c.apply(this, e);
          }
          function i(n, t) {
            return n ? r(n) : t ? void o(u) : r(null);
          }
          r = U(r || m);
          var o = a(n), c = a(e);
          i(null, !0);
        }
        function Ln(n, e, r) {
          r = U(r || m);
          var u = a(n), i = function i(n) {
            if (n) return r(n);
            var o = t(arguments, 1);
            return e.apply(this, o) ? u(i) : void r.apply(null, [ null ].concat(o));
          };
          u(i);
        }
        function On(n, t, e) {
          Ln(n, function() {
            return !t.apply(this, arguments);
          }, e);
        }
        function wn(n, t, e) {
          function r(n) {
            return n ? e(n) : void o(u);
          }
          function u(n, t) {
            return n ? e(n) : t ? void i(r) : e(null);
          }
          e = U(e || m);
          var i = a(t), o = a(n);
          o(u);
        }
        function xn(n) {
          return function(t, e, r) {
            return n(t, r);
          };
        }
        function En(n, t, e) {
          Ie(n, xn(a(t)), e);
        }
        function An(n, t, e, r) {
          z(t)(n, xn(a(e)), r);
        }
        function Tn(n) {
          return f(n) ? n : ct(function(t, e) {
            var r = !0;
            t.push(function() {
              var n = arguments;
              r ? lt(function() {
                e.apply(null, n);
              }) : e.apply(null, n);
            }), n.apply(this, t), r = !1;
          });
        }
        function Bn(n) {
          return !n;
        }
        function Fn(n) {
          return function(t) {
            return null == t ? void 0 : t[n];
          };
        }
        function In(n, t, e, r) {
          var u = new Array(t.length);
          n(t, function(n, t, r) {
            e(n, function(n, e) {
              u[t] = !!e, r(n);
            });
          }, function(n) {
            if (n) return r(n);
            for (var e = [], i = 0; i < t.length; i++) u[i] && e.push(t[i]);
            r(null, e);
          });
        }
        function _n(n, t, e, r) {
          var u = [];
          n(t, function(n, t, r) {
            e(n, function(e, i) {
              e ? r(e) : (i && u.push({
                index: t,
                value: n
              }), r());
            });
          }, function(n) {
            n ? r(n) : r(null, K(u.sort(function(n, t) {
              return n.index - t.index;
            }), Fn("value")));
          });
        }
        function Mn(n, t, e, r) {
          var u = d(t) ? In : _n;
          u(n, t, a(e), r || m);
        }
        function Un(n, t) {
          function e(n) {
            return n ? r(n) : void u(e);
          }
          var r = U(t || m), u = a(Tn(n));
          e();
        }
        function zn(n, t, e, r) {
          r = g(r || m);
          var u = {}, i = a(e);
          P(n, t, function(n, t, e) {
            i(n, t, function(n, r) {
              return n ? e(n) : (u[t] = r, void e());
            });
          }, function(n) {
            r(n, u);
          });
        }
        function Pn(n, t) {
          return t in n;
        }
        function Vn(n, e) {
          var r = Object.create(null), u = Object.create(null);
          e = e || gn;
          var i = a(n), o = ct(function(n, o) {
            var c = e.apply(null, n);
            Pn(r, c) ? lt(function() {
              o.apply(null, r[c]);
            }) : Pn(u, c) ? u[c].push(o) : (u[c] = [ o ], i.apply(null, n.concat(function() {
              var n = t(arguments);
              r[c] = n;
              var e = u[c];
              delete u[c];
              for (var i = 0, o = e.length; i < o; i++) e[i].apply(null, n);
            })));
          });
          return o.memo = r, o.unmemoized = n, o;
        }
        function qn(n, e, r) {
          r = r || m;
          var u = d(e) ? [] : {};
          n(e, function(n, e, r) {
            a(n)(function(n, i) {
              arguments.length > 2 && (i = t(arguments, 1)), u[e] = i, r(n);
            });
          }, function(n) {
            r(n, u);
          });
        }
        function Dn(n, t) {
          qn(Ie, n, t);
        }
        function Rn(n, t, e) {
          qn(z(t), n, e);
        }
        function Cn(n, t) {
          if (t = g(t || m), !Vt(n)) return t(new TypeError("First argument to race must be an array of functions"));
          if (!n.length) return t();
          for (var e = 0, r = n.length; e < r; e++) a(n[e])(t);
        }
        function $n(n, e, r, u) {
          var i = t(n).reverse();
          dn(i, e, r, u);
        }
        function Wn(n) {
          var e = a(n);
          return ct(function(n, r) {
            return n.push(function(n, e) {
              if (n) r(null, {
                error: n
              }); else {
                var u;
                u = arguments.length <= 2 ? e : t(arguments, 1), r(null, {
                  value: u
                });
              }
            }), e.apply(this, n);
          });
        }
        function Nn(n) {
          var t;
          return Vt(n) ? t = K(n, Wn) : (t = {}, N(n, function(n, e) {
            t[e] = Wn.call(this, n);
          })), t;
        }
        function Qn(n, t, e, r) {
          Mn(n, t, function(n, t) {
            e(n, function(n, e) {
              t(n, !e);
            });
          }, r);
        }
        function Gn(n) {
          return function() {
            return n;
          };
        }
        function Hn(n, t, e) {
          function r(n, t) {
            if ("object" == _typeof(t)) n.times = +t.times || i, n.intervalFunc = "function" == typeof t.interval ? t.interval : Gn(+t.interval || o), 
            n.errorFilter = t.errorFilter; else {
              if ("number" != typeof t && "string" != typeof t) throw new Error("Invalid arguments for async.retry");
              n.times = +t || i;
            }
          }
          function u() {
            f(function(n) {
              n && l++ < c.times && ("function" != typeof c.errorFilter || c.errorFilter(n)) ? setTimeout(u, c.intervalFunc(l)) : e.apply(null, arguments);
            });
          }
          var i = 5, o = 0, c = {
            times: i,
            intervalFunc: Gn(o)
          };
          if (arguments.length < 3 && "function" == typeof n ? (e = t || m, t = n) : (r(c, n), 
          e = e || m), "function" != typeof t) throw new Error("Invalid arguments for async.retry");
          var f = a(t), l = 1;
          u();
        }
        function Jn(n, t) {
          qn(Or, n, t);
        }
        function Kn(n, t, e) {
          function r(n, t) {
            var e = n.criteria, r = t.criteria;
            return e < r ? -1 : e > r ? 1 : 0;
          }
          var u = a(t);
          _e(n, function(n, t) {
            u(n, function(e, r) {
              return e ? t(e) : void t(null, {
                value: n,
                criteria: r
              });
            });
          }, function(n, t) {
            return n ? e(n) : void e(null, K(t.sort(r), Fn("value")));
          });
        }
        function Xn(n, t, e) {
          var r = a(n);
          return ct(function(u, i) {
            function o() {
              var t = n.name || "anonymous", r = new Error('Callback function "' + t + '" timed out.');
              r.code = "ETIMEDOUT", e && (r.info = e), f = !0, i(r);
            }
            var c, f = !1;
            u.push(function() {
              f || (i.apply(null, arguments), clearTimeout(c));
            }), c = setTimeout(o, t), r.apply(null, u);
          });
        }
        function Yn(n, t, e, r) {
          for (var u = -1, i = iu(uu((t - n) / (e || 1)), 0), o = Array(i); i--; ) o[r ? i : ++u] = n, 
          n += e;
          return o;
        }
        function Zn(n, t, e, r) {
          var u = a(e);
          Ue(Yn(0, n, 1), t, u, r);
        }
        function nt(n, t, e, r) {
          arguments.length <= 3 && (r = e, e = t, t = Vt(n) ? [] : {}), r = g(r || m);
          var u = a(e);
          Ie(n, function(n, e, r) {
            u(t, n, e, r);
          }, function(n) {
            r(n, t);
          });
        }
        function tt(n, e) {
          var r, u = null;
          e = e || m, Ur(n, function(n, e) {
            a(n)(function(n, i) {
              r = arguments.length > 2 ? t(arguments, 1) : i, u = n, e(!n);
            });
          }, function() {
            e(u, r);
          });
        }
        function et(n) {
          return function() {
            return (n.unmemoized || n).apply(null, arguments);
          };
        }
        function rt(n, e, r) {
          r = U(r || m);
          var u = a(e);
          if (!n()) return r(null);
          var i = function i(e) {
            if (e) return r(e);
            if (n()) return u(i);
            var o = t(arguments, 1);
            r.apply(null, [ null ].concat(o));
          };
          u(i);
        }
        function ut(n, t, e) {
          rt(function() {
            return !n.apply(this, arguments);
          }, t, e);
        }
        var it, ot = function ot(n) {
          var e = t(arguments, 1);
          return function() {
            var r = t(arguments);
            return n.apply(null, e.concat(r));
          };
        }, ct = function ct(n) {
          return function() {
            var e = t(arguments), r = e.pop();
            n.call(this, e, r);
          };
        }, ft = "function" == typeof setImmediate && setImmediate, at = "object" == ("undefined" === typeof process ? "undefined" : _typeof(process)) && "function" == typeof process.nextTick;
        it = ft ? setImmediate : at ? process.nextTick : r;
        var lt = u(it), st = "function" == typeof Symbol, pt = "object" == ("undefined" === typeof global ? "undefined" : _typeof(global)) && global && global.Object === Object && global, ht = "object" == ("undefined" === typeof self ? "undefined" : _typeof(self)) && self && self.Object === Object && self, yt = pt || ht || Function("return this")(), vt = yt.Symbol, dt = Object.prototype, mt = dt.hasOwnProperty, gt = dt.toString, bt = vt ? vt.toStringTag : void 0, jt = Object.prototype, St = jt.toString, kt = "[object Null]", Lt = "[object Undefined]", Ot = vt ? vt.toStringTag : void 0, wt = "[object AsyncFunction]", xt = "[object Function]", Et = "[object GeneratorFunction]", At = "[object Proxy]", Tt = 9007199254740991, Bt = {}, Ft = "function" == typeof Symbol && Symbol.iterator, It = function It(n) {
          return Ft && n[Ft] && n[Ft]();
        }, _t = "[object Arguments]", Mt = Object.prototype, Ut = Mt.hasOwnProperty, zt = Mt.propertyIsEnumerable, Pt = S(function() {
          return arguments;
        }()) ? S : function(n) {
          return j(n) && Ut.call(n, "callee") && !zt.call(n, "callee");
        }, Vt = Array.isArray, qt = "object" == _typeof(n) && n && !n.nodeType && n, Dt = qt && "object" == ("undefined" === typeof module ? "undefined" : _typeof(module)) && module && !module.nodeType && module, Rt = Dt && Dt.exports === qt, Ct = Rt ? yt.Buffer : void 0, $t = Ct ? Ct.isBuffer : void 0, Wt = $t || k, Nt = 9007199254740991, Qt = /^(?:0|[1-9]\d*)$/, Gt = "[object Arguments]", Ht = "[object Array]", Jt = "[object Boolean]", Kt = "[object Date]", Xt = "[object Error]", Yt = "[object Function]", Zt = "[object Map]", ne = "[object Number]", te = "[object Object]", ee = "[object RegExp]", re = "[object Set]", ue = "[object String]", ie = "[object WeakMap]", oe = "[object ArrayBuffer]", ce = "[object DataView]", fe = "[object Float32Array]", ae = "[object Float64Array]", le = "[object Int8Array]", se = "[object Int16Array]", pe = "[object Int32Array]", he = "[object Uint8Array]", ye = "[object Uint8ClampedArray]", ve = "[object Uint16Array]", de = "[object Uint32Array]", me = {};
        me[fe] = me[ae] = me[le] = me[se] = me[pe] = me[he] = me[ye] = me[ve] = me[de] = !0, 
        me[Gt] = me[Ht] = me[oe] = me[Jt] = me[ce] = me[Kt] = me[Xt] = me[Yt] = me[Zt] = me[ne] = me[te] = me[ee] = me[re] = me[ue] = me[ie] = !1;
        var ge = "object" == _typeof(n) && n && !n.nodeType && n, be = ge && "object" == ("undefined" === typeof module ? "undefined" : _typeof(module)) && module && !module.nodeType && module, je = be && be.exports === ge, Se = je && pt.process, ke = function() {
          try {
            return Se && Se.binding && Se.binding("util");
          } catch (n) {}
        }(), Le = ke && ke.isTypedArray, Oe = Le ? w(Le) : O, we = Object.prototype, xe = we.hasOwnProperty, Ee = Object.prototype, Ae = A(Object.keys, Object), Te = Object.prototype, Be = Te.hasOwnProperty, Fe = V(P, 1 / 0), Ie = function Ie(n, t, e) {
          var r = d(n) ? q : Fe;
          r(n, a(t), e);
        }, _e = D(R), Me = l(_e), Ue = C(R), ze = V(Ue, 1), Pe = l(ze), Ve = W(), qe = function qe(n, e, r) {
          function u(n, t) {
            j.push(function() {
              f(n, t);
            });
          }
          function i() {
            if (0 === j.length && 0 === v) return r(null, y);
            for (;j.length && v < e; ) {
              var n = j.shift();
              n();
            }
          }
          function o(n, t) {
            var e = b[n];
            e || (e = b[n] = []), e.push(t);
          }
          function c(n) {
            var t = b[n] || [];
            $(t, function(n) {
              n();
            }), i();
          }
          function f(n, e) {
            if (!d) {
              var u = U(function(e, u) {
                if (v--, arguments.length > 2 && (u = t(arguments, 1)), e) {
                  var i = {};
                  N(y, function(n, t) {
                    i[t] = n;
                  }), i[n] = u, d = !0, b = Object.create(null), r(e, i);
                } else y[n] = u, c(n);
              });
              v++;
              var i = a(e[e.length - 1]);
              e.length > 1 ? i(y, u) : i(u);
            }
          }
          function l() {
            for (var n, t = 0; S.length; ) n = S.pop(), t++, $(s(n), function(n) {
              0 === --k[n] && S.push(n);
            });
            if (t !== h) throw new Error("async.auto cannot execute tasks due to a recursive dependency");
          }
          function s(t) {
            var e = [];
            return N(n, function(n, r) {
              Vt(n) && J(n, t, 0) >= 0 && e.push(r);
            }), e;
          }
          "function" == typeof e && (r = e, e = null), r = g(r || m);
          var p = B(n), h = p.length;
          if (!h) return r(null);
          e || (e = h);
          var y = {}, v = 0, d = !1, b = Object.create(null), j = [], S = [], k = {};
          N(n, function(t, e) {
            if (!Vt(t)) return u(e, [ t ]), void S.push(e);
            var r = t.slice(0, t.length - 1), i = r.length;
            return 0 === i ? (u(e, t), void S.push(e)) : (k[e] = i, void $(r, function(c) {
              if (!n[c]) throw new Error("async.auto task `" + e + "` has a non-existent dependency `" + c + "` in " + r.join(", "));
              o(c, function() {
                i--, 0 === i && u(e, t);
              });
            }));
          }), l(), i();
        }, De = "[object Symbol]", Re = 1 / 0, Ce = vt ? vt.prototype : void 0, $e = Ce ? Ce.toString : void 0, We = "\\ud800-\\udfff", Ne = "\\u0300-\\u036f", Qe = "\\ufe20-\\ufe2f", Ge = "\\u20d0-\\u20ff", He = Ne + Qe + Ge, Je = "\\ufe0e\\ufe0f", Ke = "\\u200d", Xe = RegExp("[" + Ke + We + He + Je + "]"), Ye = "\\ud800-\\udfff", Ze = "\\u0300-\\u036f", nr = "\\ufe20-\\ufe2f", tr = "\\u20d0-\\u20ff", er = Ze + nr + tr, rr = "\\ufe0e\\ufe0f", ur = "[" + Ye + "]", ir = "[" + er + "]", or = "\\ud83c[\\udffb-\\udfff]", cr = "(?:" + ir + "|" + or + ")", fr = "[^" + Ye + "]", ar = "(?:\\ud83c[\\udde6-\\uddff]){2}", lr = "[\\ud800-\\udbff][\\udc00-\\udfff]", sr = "\\u200d", pr = cr + "?", hr = "[" + rr + "]?", yr = "(?:" + sr + "(?:" + [ fr, ar, lr ].join("|") + ")" + hr + pr + ")*", vr = hr + pr + yr, dr = "(?:" + [ fr + ir + "?", ir, ar, lr, ur ].join("|") + ")", mr = RegExp(or + "(?=" + or + ")|" + dr + vr, "g"), gr = /^\s+|\s+$/g, br = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m, jr = /,/, Sr = /(=.+)?(\s*)$/, kr = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
        pn.prototype.removeLink = function(n) {
          return n.prev ? n.prev.next = n.next : this.head = n.next, n.next ? n.next.prev = n.prev : this.tail = n.prev, 
          n.prev = n.next = null, this.length -= 1, n;
        }, pn.prototype.empty = function() {
          for (;this.head; ) this.shift();
          return this;
        }, pn.prototype.insertAfter = function(n, t) {
          t.prev = n, t.next = n.next, n.next ? n.next.prev = t : this.tail = t, n.next = t, 
          this.length += 1;
        }, pn.prototype.insertBefore = function(n, t) {
          t.prev = n.prev, t.next = n, n.prev ? n.prev.next = t : this.head = t, n.prev = t, 
          this.length += 1;
        }, pn.prototype.unshift = function(n) {
          this.head ? this.insertBefore(this.head, n) : hn(this, n);
        }, pn.prototype.push = function(n) {
          this.tail ? this.insertAfter(this.tail, n) : hn(this, n);
        }, pn.prototype.shift = function() {
          return this.head && this.removeLink(this.head);
        }, pn.prototype.pop = function() {
          return this.tail && this.removeLink(this.tail);
        }, pn.prototype.toArray = function() {
          for (var n = Array(this.length), t = this.head, e = 0; e < this.length; e++) n[e] = t.data, 
          t = t.next;
          return n;
        }, pn.prototype.remove = function(n) {
          for (var t = this.head; t; ) {
            var e = t.next;
            n(t) && this.removeLink(t), t = e;
          }
          return this;
        };
        var Lr, Or = V(P, 1), wr = function wr() {
          return mn.apply(null, t(arguments).reverse());
        }, xr = Array.prototype.concat, Er = function Er(n, e, r, u) {
          u = u || m;
          var i = a(r);
          Ue(n, e, function(n, e) {
            i(n, function(n) {
              return n ? e(n) : e(null, t(arguments, 1));
            });
          }, function(n, t) {
            for (var e = [], r = 0; r < t.length; r++) t[r] && (e = xr.apply(e, t[r]));
            return u(n, e);
          });
        }, Ar = V(Er, 1 / 0), Tr = V(Er, 1), Br = function Br() {
          var n = t(arguments), e = [ null ].concat(n);
          return function() {
            var n = arguments[arguments.length - 1];
            return n.apply(this, e);
          };
        }, Fr = D(bn(gn, jn)), Ir = C(bn(gn, jn)), _r = V(Ir, 1), Mr = Sn("dir"), Ur = V(An, 1), zr = D(bn(Bn, Bn)), Pr = C(bn(Bn, Bn)), Vr = V(Pr, 1), qr = D(Mn), Dr = C(Mn), Rr = V(Dr, 1), Cr = function Cr(n, t, e, r) {
          r = r || m;
          var u = a(e);
          Ue(n, t, function(n, t) {
            u(n, function(e, r) {
              return e ? t(e) : t(null, {
                key: r,
                val: n
              });
            });
          }, function(n, t) {
            for (var e = {}, u = Object.prototype.hasOwnProperty, i = 0; i < t.length; i++) if (t[i]) {
              var o = t[i].key, c = t[i].val;
              u.call(e, o) ? e[o].push(c) : e[o] = [ c ];
            }
            return r(n, e);
          });
        }, $r = V(Cr, 1 / 0), Wr = V(Cr, 1), Nr = Sn("log"), Qr = V(zn, 1 / 0), Gr = V(zn, 1);
        Lr = at ? process.nextTick : ft ? setImmediate : r;
        var Hr = u(Lr), Jr = function Jr(n, t) {
          var e = a(n);
          return yn(function(n, t) {
            e(n[0], t);
          }, t, 1);
        }, Kr = function Kr(n, t) {
          var e = Jr(n, t);
          return e.push = function(n, t, r) {
            if (null == r && (r = m), "function" != typeof r) throw new Error("task callback must be a function");
            if (e.started = !0, Vt(n) || (n = [ n ]), 0 === n.length) return lt(function() {
              e.drain();
            });
            t = t || 0;
            for (var u = e._tasks.head; u && t >= u.priority; ) u = u.next;
            for (var i = 0, o = n.length; i < o; i++) {
              var c = {
                data: n[i],
                priority: t,
                callback: r
              };
              u ? e._tasks.insertBefore(u, c) : e._tasks.push(c);
            }
            lt(e.process);
          }, delete e.unshift, e;
        }, Xr = D(Qn), Yr = C(Qn), Zr = V(Yr, 1), nu = function nu(n, t) {
          t || (t = n, n = null);
          var e = a(t);
          return ct(function(t, r) {
            function u(n) {
              e.apply(null, t.concat(n));
            }
            n ? Hn(n, u, r) : Hn(u, r);
          });
        }, tu = D(bn(Boolean, gn)), eu = C(bn(Boolean, gn)), ru = V(eu, 1), uu = Math.ceil, iu = Math.max, ou = V(Zn, 1 / 0), cu = V(Zn, 1), fu = function fu(n, e) {
          function r(t) {
            var e = a(n[i++]);
            t.push(U(u)), e.apply(null, t);
          }
          function u(u) {
            return u || i === n.length ? e.apply(null, arguments) : void r(t(arguments, 1));
          }
          if (e = g(e || m), !Vt(n)) return e(new Error("First argument to waterfall must be an array of functions"));
          if (!n.length) return e();
          var i = 0;
          r([]);
        }, au = {
          apply: ot,
          applyEach: Me,
          applyEachSeries: Pe,
          asyncify: i,
          auto: qe,
          autoInject: sn,
          cargo: vn,
          compose: wr,
          concat: Ar,
          concatLimit: Er,
          concatSeries: Tr,
          constant: Br,
          detect: Fr,
          detectLimit: Ir,
          detectSeries: _r,
          dir: Mr,
          doDuring: kn,
          doUntil: On,
          doWhilst: Ln,
          during: wn,
          each: En,
          eachLimit: An,
          eachOf: Ie,
          eachOfLimit: P,
          eachOfSeries: Or,
          eachSeries: Ur,
          ensureAsync: Tn,
          every: zr,
          everyLimit: Pr,
          everySeries: Vr,
          filter: qr,
          filterLimit: Dr,
          filterSeries: Rr,
          forever: Un,
          groupBy: $r,
          groupByLimit: Cr,
          groupBySeries: Wr,
          log: Nr,
          map: _e,
          mapLimit: Ue,
          mapSeries: ze,
          mapValues: Qr,
          mapValuesLimit: zn,
          mapValuesSeries: Gr,
          memoize: Vn,
          nextTick: Hr,
          parallel: Dn,
          parallelLimit: Rn,
          priorityQueue: Kr,
          queue: Jr,
          race: Cn,
          reduce: dn,
          reduceRight: $n,
          reflect: Wn,
          reflectAll: Nn,
          reject: Xr,
          rejectLimit: Yr,
          rejectSeries: Zr,
          retry: Hn,
          retryable: nu,
          seq: mn,
          series: Jn,
          setImmediate: lt,
          some: tu,
          someLimit: eu,
          someSeries: ru,
          sortBy: Kn,
          timeout: Xn,
          times: ou,
          timesLimit: Zn,
          timesSeries: cu,
          transform: nt,
          tryEach: tt,
          unmemoize: et,
          until: ut,
          waterfall: fu,
          whilst: rt,
          all: zr,
          allLimit: Pr,
          allSeries: Vr,
          any: tu,
          anyLimit: eu,
          anySeries: ru,
          find: Fr,
          findLimit: Ir,
          findSeries: _r,
          forEach: En,
          forEachSeries: Ur,
          forEachLimit: An,
          forEachOf: Ie,
          forEachOfSeries: Or,
          forEachOfLimit: P,
          inject: dn,
          foldl: dn,
          foldr: $n,
          select: qr,
          selectLimit: Dr,
          selectSeries: Rr,
          wrapSync: i
        };
        n["default"] = au, n.apply = ot, n.applyEach = Me, n.applyEachSeries = Pe, n.asyncify = i, 
        n.auto = qe, n.autoInject = sn, n.cargo = vn, n.compose = wr, n.concat = Ar, n.concatLimit = Er, 
        n.concatSeries = Tr, n.constant = Br, n.detect = Fr, n.detectLimit = Ir, n.detectSeries = _r, 
        n.dir = Mr, n.doDuring = kn, n.doUntil = On, n.doWhilst = Ln, n.during = wn, n.each = En, 
        n.eachLimit = An, n.eachOf = Ie, n.eachOfLimit = P, n.eachOfSeries = Or, n.eachSeries = Ur, 
        n.ensureAsync = Tn, n.every = zr, n.everyLimit = Pr, n.everySeries = Vr, n.filter = qr, 
        n.filterLimit = Dr, n.filterSeries = Rr, n.forever = Un, n.groupBy = $r, n.groupByLimit = Cr, 
        n.groupBySeries = Wr, n.log = Nr, n.map = _e, n.mapLimit = Ue, n.mapSeries = ze, 
        n.mapValues = Qr, n.mapValuesLimit = zn, n.mapValuesSeries = Gr, n.memoize = Vn, 
        n.nextTick = Hr, n.parallel = Dn, n.parallelLimit = Rn, n.priorityQueue = Kr, n.queue = Jr, 
        n.race = Cn, n.reduce = dn, n.reduceRight = $n, n.reflect = Wn, n.reflectAll = Nn, 
        n.reject = Xr, n.rejectLimit = Yr, n.rejectSeries = Zr, n.retry = Hn, n.retryable = nu, 
        n.seq = mn, n.series = Jn, n.setImmediate = lt, n.some = tu, n.someLimit = eu, n.someSeries = ru, 
        n.sortBy = Kn, n.timeout = Xn, n.times = ou, n.timesLimit = Zn, n.timesSeries = cu, 
        n.transform = nt, n.tryEach = tt, n.unmemoize = et, n.until = ut, n.waterfall = fu, 
        n.whilst = rt, n.all = zr, n.allLimit = Pr, n.allSeries = Vr, n.any = tu, n.anyLimit = eu, 
        n.anySeries = ru, n.find = Fr, n.findLimit = Ir, n.findSeries = _r, n.forEach = En, 
        n.forEachSeries = Ur, n.forEachLimit = An, n.forEachOf = Ie, n.forEachOfSeries = Or, 
        n.forEachOfLimit = P, n.inject = dn, n.foldl = dn, n.foldr = $n, n.select = qr, 
        n.selectLimit = Dr, n.selectSeries = Rr, n.wrapSync = i, Object.defineProperty(n, "__esModule", {
          value: !0
        });
      });
      cc._RF.pop();
    }).call(this, require("_process"), "undefined" !== typeof global ? global : "undefined" !== typeof self ? self : "undefined" !== typeof window ? window : {});
  }, {
    _process: 2
  } ],
  auto_LoadingTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4f2d6VShQlEDqOfJEEIQikQ", "auto_LoadingTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_LoadingTip = function(_super) {
      __extends(auto_LoadingTip, _super);
      function auto_LoadingTip() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_LoadingTip.prototype.onLoad = function() {
        this.Loading = this.node;
        this.loading = this.Loading.getChildByName("loading");
        this.refresh = this.Loading.getChildByName("refresh");
        this.exclamation = this.refresh.getChildByName("exclamation");
      };
      auto_LoadingTip.URL = "db://assets/resources/prefab/tips/LoadingTip.prefab";
      auto_LoadingTip = __decorate([ ccclass ], auto_LoadingTip);
      return auto_LoadingTip;
    }(cc.Component);
    exports.default = auto_LoadingTip;
    cc._RF.pop();
  }, {} ],
  auto_SceneLoadingTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "8df93wyHZ5PZomClRBFw9Ms", "auto_SceneLoadingTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_SceneLoadingTip = function(_super) {
      __extends(auto_SceneLoadingTip, _super);
      function auto_SceneLoadingTip() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_SceneLoadingTip.prototype.onLoad = function() {
        this.LoadingTip = this.node;
        this.Label = this.LoadingTip.getChildByName("Label");
      };
      auto_SceneLoadingTip.URL = "db://assets/commonPrefab/LoadingTip/LoadingTip.prefab";
      auto_SceneLoadingTip = __decorate([ ccclass ], auto_SceneLoadingTip);
      return auto_SceneLoadingTip;
    }(cc.Component);
    exports.default = auto_SceneLoadingTip;
    cc._RF.pop();
  }, {} ],
  auto_confirmDialog: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ceaf8kfm59KI73jAQbzXf/Z", "auto_confirmDialog");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_confirmDialog = function(_super) {
      __extends(auto_confirmDialog, _super);
      function auto_confirmDialog() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_confirmDialog.prototype.onLoad = function() {
        this.confirmDialog = this.node;
        this.background = this.confirmDialog.getChildByName("background");
        this.lbl_title = this.confirmDialog.getChildByName("lbl_title");
        this.lbl_content = this.confirmDialog.getChildByName("lbl_content");
        this.btn_cancel = this.confirmDialog.getChildByName("btn_cancel");
        this.Background = this.btn_cancel.getChildByName("Background");
        this.Label = this.Background.getChildByName("Label");
        this.btn_certain = this.confirmDialog.getChildByName("btn_certain");
      };
      auto_confirmDialog.URL = "db://assets/resources/prefab/tips/confirmDialog.prefab";
      auto_confirmDialog = __decorate([ ccclass ], auto_confirmDialog);
      return auto_confirmDialog;
    }(cc.Component);
    exports.default = auto_confirmDialog;
    cc._RF.pop();
  }, {} ],
  auto_detailTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "7a8b924rvJMPbdOUggwedT7", "auto_detailTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_detailTip = function(_super) {
      __extends(auto_detailTip, _super);
      function auto_detailTip() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_detailTip.prototype.onLoad = function() {
        this.detailTip = this.node;
        this.bg = this.detailTip.getChildByName("bg");
        this.title = this.bg.getChildByName("title");
        this.RichText = this.bg.getChildByName("RichText");
        this.Common_Button_Cancel = this.bg.getChildByName("Common_Button_Cancel");
        this.Common_Button_Ok = this.bg.getChildByName("Common_Button_Ok");
      };
      auto_detailTip.URL = "db://assets/resources/prefab/tips/detailTip.prefab";
      auto_detailTip = __decorate([ ccclass ], auto_detailTip);
      return auto_detailTip;
    }(cc.Component);
    exports.default = auto_detailTip;
    cc._RF.pop();
  }, {} ],
  auto_gameOver: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "94fb5uhYPlIAbQaEWKURtMB", "auto_gameOver");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, executeInEditMode = _a.executeInEditMode, property = _a.property;
    var auto_gameOver = function(_super) {
      __extends(auto_gameOver, _super);
      function auto_gameOver() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.btnEnter = null;
        _this.btnClose = null;
        _this.lblDistance = null;
        _this.lblMaxDistance = null;
        return _this;
      }
      auto_gameOver.prototype.onLoad = function() {
        true;
        return;
      };
      __decorate([ property(cc.Button) ], auto_gameOver.prototype, "btnEnter", void 0);
      __decorate([ property(cc.Button) ], auto_gameOver.prototype, "btnClose", void 0);
      __decorate([ property(cc.Label) ], auto_gameOver.prototype, "lblDistance", void 0);
      __decorate([ property(cc.Label) ], auto_gameOver.prototype, "lblMaxDistance", void 0);
      auto_gameOver = __decorate([ ccclass, executeInEditMode ], auto_gameOver);
      return auto_gameOver;
    }(cc.Component);
    exports.default = auto_gameOver;
    cc._RF.pop();
  }, {} ],
  auto_loading: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "dd99azwfnFBDqIEvSRn8rYj", "auto_loading");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, executeInEditMode = _a.executeInEditMode, property = _a.property;
    var auto_loading = function(_super) {
      __extends(auto_loading, _super);
      function auto_loading() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.lblTitle = null;
        _this.btnSound = null;
        _this.btnEditInfo = null;
        _this.btnRankList = null;
        _this.btnPlayGame = null;
        return _this;
      }
      auto_loading.prototype.onLoad = function() {
        true;
        return;
      };
      __decorate([ property(cc.Label) ], auto_loading.prototype, "lblTitle", void 0);
      __decorate([ property(cc.Button) ], auto_loading.prototype, "btnSound", void 0);
      __decorate([ property(cc.Button) ], auto_loading.prototype, "btnEditInfo", void 0);
      __decorate([ property(cc.Button) ], auto_loading.prototype, "btnRankList", void 0);
      __decorate([ property(cc.Button) ], auto_loading.prototype, "btnPlayGame", void 0);
      auto_loading = __decorate([ ccclass, executeInEditMode ], auto_loading);
      return auto_loading;
    }(cc.Component);
    exports.default = auto_loading;
    cc._RF.pop();
  }, {} ],
  auto_loseTip: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "46a02VpzQJKT5G8++0HQ2wH", "auto_loseTip");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_loseTip = function(_super) {
      __extends(auto_loseTip, _super);
      function auto_loseTip() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_loseTip.prototype.onLoad = function() {
        this.detailTip = this.node;
        this.bg = this.detailTip.getChildByName("bg");
        this.title = this.bg.getChildByName("title");
      };
      auto_loseTip.URL = "db://assets/resources/prefab/tips/loseTip.prefab";
      auto_loseTip = __decorate([ ccclass ], auto_loseTip);
      return auto_loseTip;
    }(cc.Component);
    exports.default = auto_loseTip;
    cc._RF.pop();
  }, {} ],
  auto_offlinePanel: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "c4345/XlhpMXYZtWPqQUajQ", "auto_offlinePanel");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_offlinePanel = function(_super) {
      __extends(auto_offlinePanel, _super);
      function auto_offlinePanel() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_offlinePanel.prototype.onLoad = function() {
        this.offlinePanel = this.node;
        this.title_bg = this.offlinePanel.getChildByName("title_bg");
        this.UI_111 = this.offlinePanel.getChildByName("UI_111");
        this.currency_bg1 = this.offlinePanel.getChildByName("currency_bg1");
        this.UI_153 = this.currency_bg1.getChildByName("UI_153");
        this.gold_num = this.currency_bg1.getChildByName("gold_num");
        this.currency_bg = this.offlinePanel.getChildByName("currency_bg");
        this.soul_num = this.currency_bg.getChildByName("soul_num");
        this.bufficon = this.offlinePanel.getChildByName("bufficon");
        this.content = this.offlinePanel.getChildByName("content");
      };
      auto_offlinePanel.URL = "db://assets/resources/prefab/tips/offlinePanel.prefab";
      auto_offlinePanel = __decorate([ ccclass ], auto_offlinePanel);
      return auto_offlinePanel;
    }(cc.Component);
    exports.default = auto_offlinePanel;
    cc._RF.pop();
  }, {} ],
  auto_playerInfo: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "6e0500/f2xO7pb82Jk+1Wb9", "auto_playerInfo");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, executeInEditMode = _a.executeInEditMode, property = _a.property;
    var auto_playerInfo = function(_super) {
      __extends(auto_playerInfo, _super);
      function auto_playerInfo() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.useName = null;
        _this.useIdCard = null;
        _this.usePhone = null;
        _this.useAddress = null;
        _this.useSex = null;
        _this.btnEnter = null;
        return _this;
      }
      auto_playerInfo.prototype.onLoad = function() {
        true;
        return;
      };
      __decorate([ property(cc.EditBox) ], auto_playerInfo.prototype, "useName", void 0);
      __decorate([ property(cc.EditBox) ], auto_playerInfo.prototype, "useIdCard", void 0);
      __decorate([ property(cc.EditBox) ], auto_playerInfo.prototype, "usePhone", void 0);
      __decorate([ property(cc.EditBox) ], auto_playerInfo.prototype, "useAddress", void 0);
      __decorate([ property(cc.ToggleContainer) ], auto_playerInfo.prototype, "useSex", void 0);
      __decorate([ property(cc.Button) ], auto_playerInfo.prototype, "btnEnter", void 0);
      auto_playerInfo = __decorate([ ccclass, executeInEditMode ], auto_playerInfo);
      return auto_playerInfo;
    }(cc.Component);
    exports.default = auto_playerInfo;
    cc._RF.pop();
  }, {} ],
  auto_rankItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "79775yMZ0FIe7vpIxKLA9mJ", "auto_rankItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_rankItem = function(_super) {
      __extends(auto_rankItem, _super);
      function auto_rankItem() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.sprAchivIcon = null;
        _this.lblScore = null;
        _this.lblName = null;
        _this.lblStage = null;
        _this.lblTime = null;
        _this.useAvatarIda = null;
        return _this;
      }
      auto_rankItem.prototype.onLoad = function() {
        this.sprAchivIcon = cc.find("panel_base/spr_achiv_icon", this.node).getComponent(cc.Sprite);
        this.lblScore = cc.find("panel_base/lbl_score", this.node).getComponent(cc.Label);
        this.lblName = cc.find("panel_base/lbl_name", this.node).getComponent(cc.Label);
        this.lblStage = cc.find("panel_base/lbl_stage", this.node).getComponent(cc.Label);
        this.lblTime = cc.find("panel_base/lbl_time", this.node).getComponent(cc.Label);
        this.useAvatarIda = cc.find("panel_base/use_avatar_ida", this.node).getComponent(cc.Sprite);
      };
      auto_rankItem = __decorate([ ccclass ], auto_rankItem);
      return auto_rankItem;
    }(cc.Component);
    exports.default = auto_rankItem;
    cc._RF.pop();
  }, {} ],
  auto_responsibility: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "a0fc535jO1H3Y1N//1XvqOz", "auto_responsibility");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, executeInEditMode = _a.executeInEditMode, property = _a.property;
    var auto_responsibility = function(_super) {
      __extends(auto_responsibility, _super);
      function auto_responsibility() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.btnEnter = null;
        _this.lblAgree = null;
        return _this;
      }
      auto_responsibility.prototype.onLoad = function() {
        true;
        return;
      };
      __decorate([ property(cc.Button) ], auto_responsibility.prototype, "btnEnter", void 0);
      __decorate([ property(cc.Label) ], auto_responsibility.prototype, "lblAgree", void 0);
      auto_responsibility = __decorate([ ccclass, executeInEditMode ], auto_responsibility);
      return auto_responsibility;
    }(cc.Component);
    exports.default = auto_responsibility;
    cc._RF.pop();
  }, {} ],
  auto_tipsItem: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ac685Xh+FVMwZTcBlmS5d6i", "auto_tipsItem");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_tipsItem = function(_super) {
      __extends(auto_tipsItem, _super);
      function auto_tipsItem() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_tipsItem.prototype.onLoad = function() {
        this.tipsItem = this.node;
        this.TipsBg = this.tipsItem.getChildByName("TipsBg");
        this.Label = this.TipsBg.getChildByName("Label");
      };
      auto_tipsItem.URL = "db://assets/resources/prefab/tips/tipsItem.prefab";
      auto_tipsItem = __decorate([ ccclass ], auto_tipsItem);
      return auto_tipsItem;
    }(cc.Component);
    exports.default = auto_tipsItem;
    cc._RF.pop();
  }, {} ],
  auto_tips: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "52aa4+jpEBNj7LS0ejWzlR9", "auto_tips");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var ccclass = cc._decorator.ccclass;
    var auto_tips = function(_super) {
      __extends(auto_tips, _super);
      function auto_tips() {
        return null !== _super && _super.apply(this, arguments) || this;
      }
      auto_tips.prototype.onLoad = function() {
        this.tips = this.node;
      };
      auto_tips.URL = "db://assets/resources/prefab/tips/tips.prefab";
      auto_tips = __decorate([ ccclass ], auto_tips);
      return auto_tips;
    }(cc.Component);
    exports.default = auto_tips;
    cc._RF.pop();
  }, {} ],
  auto_worldRankList: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "ec867QZTOlMmZz7idFpQtAE", "auto_worldRankList");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var List_1 = require("../../../commonLib/main/ui/List/List");
    var RankItem_1 = require("./RankItem");
    var ccclass = cc._decorator.ccclass;
    var auto_worldRankList = function(_super) {
      __extends(auto_worldRankList, _super);
      function auto_worldRankList() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.useClose = null;
        _this.fltScrollView = null;
        _this.fltRankItem = null;
        _this.btnBack = null;
        return _this;
      }
      auto_worldRankList.prototype.onLoad = function() {
        this.useClose = cc.find("use_close", this.node);
        this.fltScrollView = cc.find("bg/flt_ScrollView", this.node).getComponent(List_1.default);
        this.fltRankItem = cc.find("bg/flt_rankItem", this.node).getComponent(RankItem_1.default);
        this.btnBack = cc.find("bg/top_bar/btn_Back", this.node).getComponent(cc.Button);
      };
      auto_worldRankList = __decorate([ ccclass ], auto_worldRankList);
      return auto_worldRankList;
    }(cc.Component);
    exports.default = auto_worldRankList;
    cc._RF.pop();
  }, {
    "../../../commonLib/main/ui/List/List": "List",
    "./RankItem": "RankItem"
  } ],
  cloud: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f9929JSAYhKR7C34dP6eiBH", "cloud");
    "use strict";
    (function() {
      cc.cloud = {
        initialized: false,
        initialize: function initialize(config) {
          "undefined" !== typeof config && null !== config || (config = cc_cloud_commonConfig);
          if ("tencent" === config.platform) {
            if (this.initialized) return this.tencentApp;
            cloudbase && cloudbase.useAdapters(window.adapter);
            this.tencentApp = cloudbase ? cloudbase.init(config.tencent) : null;
            this.initialized = true;
            return this.tencentApp;
          }
          return null;
        }
      };
    })();
    cc._RF.pop();
  }, {} ],
  locator: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "a392cmryilHj7Tuk+QEgAm/", "locator");
    "use strict";
    var Locator = {
      timeout: 5e3,
      parse: function parse(locator) {
        cc.assert(locator, "locator string is null");
        var names = locator.split(/[.,//,>,#]/g);
        var segments = names.map(function(name) {
          var index = locator.indexOf(name);
          var symbol = locator[index - 1] || ">";
          return {
            symbol: symbol,
            name: name.trim()
          };
        });
        return segments;
      },
      seekNodeByName: function seekNodeByName(root, name) {
        if (!root) return null;
        if (root.getName() == name) return root;
        var arrayRootChildren = root.getChildren();
        var length = arrayRootChildren.length;
        for (var i = 0; i < length; i++) {
          var child = arrayRootChildren[i];
          var res = this.seekNodeByName(child, name);
          if (null != res) return res;
        }
        return null;
      },
      locateNode: function locateNode(root, locator, cb) {
        if (!this.locating) {
          this.startTime = Date.now();
          this.locating = true;
        }
        var segments = this.parse(locator);
        cc.assert(segments && segments.length);
        var child, node = root;
        for (var i = 0; i < segments.length; i++) {
          var item = segments[i];
          switch (item.symbol) {
           case "/":
            child = node.getChildByName(item.name);
            break;

           case ".":
            child = node[item.name];
            break;

           case ">":
            child = this.seekNodeByName(node, item.name);
            break;

           case "#":
            child = this.seekNodeByTag(node, item.name);
          }
          if (!child) {
            node = null;
            break;
          }
          node = child;
        }
        if (node && node.active && cb) {
          this.locating = false;
          cb(null, node);
        } else cb && (Date.now() - this.startTime > this.timeout ? cb({
          error: "timeout",
          locator: locator
        }) : setTimeout(function() {
          Locator.locateNode(root, locator, cb);
        }, 10));
        return node;
      },
      getNodeFullPath: function getNodeFullPath(node) {
        var array = [];
        var temp = node;
        do {
          array.unshift(temp.name);
          temp = temp.parent;
        } while (temp && "Canvas" !== temp.name);
        return array.join("/");
      }
    };
    window.Locator = Locator;
    module.exports = Locator;
    cc._RF.pop();
  }, {} ],
  "task-02": [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "1ce3bfpYbNCMrYzwNqg/WQT", "task-02");
    "use strict";
    cc._RF.pop();
  }, {} ],
  "task1-01": [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "fff37G5RJRIaLo8tHxdrqbx", "task1-01");
    "use strict";
    cc._RF.pop();
  }, {} ],
  "transition-materials": [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f0ae4vfa41KnqZDrdPXlP7n", "transition-materials");
    "use strict";
    cc._RF.pop();
  }, {} ],
  "transitions-inspector": [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "71a0bxK615KUpG3F4y4AWg7", "transitions-inspector");
    "use strict";
    false;
    cc._RF.pop();
  }, {} ],
  transitions: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "24cfdwVNiRAr45L2SE+u3Ib", "transitions");
    "use strict";
    var SceneUtil = require("SceneUtil")["default"];
    var BackgroundAdapter = require("BackgroundAdapter")["default"];
    var Transitions = cc.Class({
      extends: cc.Component,
      editor: {
        inspector: "undefined" !== typeof Editor && Editor.url(" db://assets/gameRes/texture/shader/transitions/editor/transitions-inspector.js")
      },
      properties: {
        _material: {
          default: null,
          type: cc.Material
        },
        material: {
          get: function get() {
            return this._material;
          },
          set: function set(v) {
            this._material = v;
            this.updateSpriteMaterial();
          },
          type: cc.Material,
          readonly: true
        },
        transitionTime: 1
      },
      onLoad: function onLoad() {
        cc.game.addPersistRootNode(this.node);
      },
      start: function start() {
        this.init();
      },
      init: function init() {
        if (this._inited) return;
        this._inited = true;
        this.time = 0;
        this._texture1 = this.createTexture();
        this._texture2 = this.createTexture();
        var spriteNode = cc.find("TRANSITION_SPRITE", this.node);
        if (spriteNode) this._sprite = spriteNode.getComponent(cc.Sprite); else {
          spriteNode = new cc.Node("TRANSITION_SPRITE");
          this._sprite = spriteNode.addComponent(cc.Sprite);
          spriteNode.parent = this.node;
        }
        var spriteFrame = new cc.SpriteFrame();
        spriteFrame.setTexture(this._texture1);
        this._sprite.spriteFrame = spriteFrame;
        spriteNode.active = false;
        spriteNode.scaleY = -1;
        this._spriteNode = spriteNode;
        var cameraNode = cc.find("TRANSITION_CAMERA", this.node);
        if (cameraNode) this._camera = cameraNode.getComponent(cc.Camera); else {
          cameraNode = new cc.Node("TRANSITION_CAMERA");
          this._camera = cameraNode.addComponent(cc.Camera);
          cameraNode.parent = this.node;
        }
        cameraNode.active = false;
        this._cameraNode = cameraNode;
        this.node.groupIndex = cc.Node.BuiltinGroupIndex.DEBUG - 1;
        this._camera.cullingMask = 1 << this.node.groupIndex;
        this.updateSpriteMaterial();
      },
      updateSpriteMaterial: function updateSpriteMaterial() {
        if (!this._sprite) return;
        var newMaterial = cc.MaterialVariant.create(this._material);
        newMaterial.setProperty("texture2", this._texture2);
        newMaterial.setProperty("ratio", this._texture2.width / this._texture2.height);
        newMaterial.setProperty("screenSize", new Float32Array([ cc.visibleRect.width, cc.visibleRect.height ]));
        this._sprite.setMaterial(0, newMaterial);
        this._spriteMaterial = newMaterial;
      },
      createTexture: function createTexture() {
        var texture = new cc.RenderTexture();
        texture.initWithSize(this.node.width, this.node.height, cc.gfx.RB_FMT_D24S8);
        return texture;
      },
      _loadScene: function _loadScene(sceneUrl, fromCameraPath, toCameraPath, onSceneLoaded, onTransitionFinished) {
        var _this = this;
        this.init();
        this._spriteNode.active = true;
        this._cameraNode.active = true;
        var fromCamera = cc.find(fromCameraPath);
        fromCamera = fromCamera && fromCamera.getComponent(cc.Camera);
        if (!fromCamera) {
          cc.warn("Can not find fromCamera with path ".concat(fromCameraPath));
          return;
        }
        var originTargetTexture1 = fromCamera.targetTexture;
        fromCamera.cullingMask &= ~this._camera.cullingMask;
        fromCamera.targetTexture = this._texture1;
        fromCamera.render(cc.director.getScene());
        fromCamera.targetTexture = originTargetTexture1;
        return SceneUtil.switchScene(sceneUrl, function() {
          onSceneLoaded && onSceneLoaded();
          var toCamera = cc.find(toCameraPath);
          toCamera = toCamera && toCamera.getComponent(cc.Camera);
          if (!toCamera) {
            cc.warn("Can not find toCamera with path ".concat(toCameraPath));
            return;
          }
          toCamera.cullingMask &= ~_this._camera.cullingMask;
          var originTargetTexture2 = toCamera.targetTexture;
          toCamera.targetTexture = _this._texture2;
          toCamera.render(cc.director.getScene());
          _this._camera.depth = toCamera.depth;
          _this._camera.clearFlags = toCamera.clearFlags;
          _this._onLoadFinished = function() {
            toCamera.targetTexture = originTargetTexture2;
            _this._spriteNode.active = false;
            _this._cameraNode.active = false;
            onTransitionFinished && onTransitionFinished();
          };
          _this.time = 0;
          _this.loading = true;
        });
      },
      loadScene: function loadScene(sceneUrl, fromCameraPath, toCameraPath, cb, finash) {
        var _this2 = this;
        this.scheduleOnce(function() {
          SceneUtil.preloadScene(sceneUrl, null, function() {
            _this2._loadScene(sceneUrl, fromCameraPath, toCameraPath, cb, finash);
          });
        });
        return true;
      },
      loadNode: function loadNode(fromCamera, fromRootNode, toCamera, toRootNode, onTransitionFinished) {
        var _this3 = this;
        this.init();
        this._spriteNode.active = true;
        this._cameraNode.active = true;
        fromCamera = fromCamera && fromCamera.getComponent(cc.Camera);
        if (!fromCamera) {
          cc.warn("Can not find fromCamera with path ".concat(fromCameraPath));
          return;
        }
        var originTargetTexture1 = fromCamera.targetTexture;
        fromCamera.cullingMask &= ~this._camera.cullingMask;
        fromCamera.targetTexture = this._texture1;
        fromCamera.node.active = true;
        fromRootNode.active = true;
        fromCamera.render(fromRootNode);
        fromRootNode.active = false;
        fromCamera.node.active = false;
        fromCamera.targetTexture = originTargetTexture1;
        toCamera = toCamera && toCamera.getComponent(cc.Camera);
        if (!toCamera) {
          cc.warn("Can not find toCamera with path ".concat(toCameraPath));
          return;
        }
        toCamera.cullingMask &= ~this._camera.cullingMask;
        var originTargetTexture2 = toCamera.targetTexture;
        toCamera.node.active = true;
        toCamera.targetTexture = this._texture2;
        toRootNode.active = true;
        toCamera.render(toRootNode);
        toRootNode.active = false;
        toCamera.node.active = false;
        this._camera.depth = toCamera.depth;
        this._camera.clearFlags = toCamera.clearFlags;
        this._onLoadFinished = function() {
          toRootNode.active = true;
          toCamera.node.active = true;
          toCamera.targetTexture = originTargetTexture2;
          _this3._spriteNode.active = false;
          _this3._cameraNode.active = false;
          onTransitionFinished && onTransitionFinished();
        };
        this.time = 0;
        this.loading = true;
        this._spriteMaterial.setProperty("time", 0);
      },
      update: function update(dt) {
        if (this.loading) {
          this.time += dt;
          if (this.time >= this.transitionTime) {
            this.time = this.transitionTime;
            this.loading = false;
            this._onLoadFinished && this._onLoadFinished();
            this._onLoadFinished = null;
          }
          this._spriteMaterial.setProperty("time", this.time / this.transitionTime);
        }
      }
    });
    cc._RF.pop();
  }, {
    BackgroundAdapter: "BackgroundAdapter",
    SceneUtil: "SceneUtil"
  } ],
  ui_switcher: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4764dPYeGlFvaKpNs7SX6Yp", "ui_switcher");
    "use strict";
    var CCTransform = cc.Class({
      name: "CCTransform",
      properties: {
        nodeUuid: {
          default: ""
        },
        guid: {
          default: ""
        },
        stateUuid: {
          default: ""
        },
        active: {
          default: true
        },
        position: {
          default: new cc.Vec2(0, 0)
        },
        rotation: {
          default: 0
        },
        scale: {
          default: new cc.Vec2(0, 0)
        },
        anchor: {
          default: new cc.Vec2(0, 0)
        },
        size: {
          default: new cc.Vec2(0, 0)
        },
        color: {
          default: new cc.Vec3(255, 255, 255)
        },
        opacity: {
          default: 255
        },
        spriteFrame: {
          default: null
        }
      }
    });
    var SwitchState = cc.Class({
      name: "SwitchState",
      properties: {
        uuid: {
          default: ""
        },
        name: {
          default: ""
        }
      }
    });
    var TargetNode = cc.Class({
      name: "TargetNode",
      properties: {
        guid: {
          default: ""
        },
        node: {
          default: null,
          type: cc.Node
        }
      }
    });
    module.exports["default"] = cc.Class({
      extends: cc.Component,
      editor: false,
      properties: {
        targetNodes: {
          default: [],
          type: [ cc.TargetNode ]
        },
        switchStates: {
          default: [],
          type: [ cc.SwitchState ]
        },
        onSwitchStatesChange: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            if (value) {
              var states = [];
              for (var i = 0; i < value.length; i++) {
                var item = value[i];
                var state = new SwitchState();
                state.uuid = item.uuid;
                state.name = item.name;
                states.push(state);
              }
              this.switchStates = states;
            }
          }
        },
        onRemoveSwitchState: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            if (value) {
              var states = [];
              for (var i = 0; i < this.switchStates.length; i++) value != this.switchStates[i].uuid && states.push(this.switchStates[i]);
              this.switchStates = states;
              var transforms = [];
              for (var _i = 0; _i < this.ccTransforms.length; _i++) this.ccTransforms[_i].stateUuid != value && transforms.push(this.ccTransforms[_i]);
              this.ccTransforms = transforms;
            } else cc.error("\u5220\u9664\u76ee\u6807\u503c\u9519\u8bef");
          }
        },
        onAddSwitchState: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            if (value) {
              var state = new SwitchState();
              state.uuid = value;
              state.name = "";
              this.switchStates.push(state);
              this._removeStateByUuid(value);
              this._addStateByUuid(value);
            }
          }
        },
        curState: {
          default: 0
        },
        onCurStateChange: {
          type: cc.Integer,
          get: function get() {
            return this.curState;
          },
          set: function set(index) {
            this.curState = index;
            this._onCurStateChange(index);
          }
        },
        ccTransforms: {
          default: [],
          type: [ cc.CCTransform ]
        },
        onTransChange: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            if (value) {
              var transforms = [];
              var stateUuid = value[0].stateUuid;
              for (var i = 0; i < this.ccTransforms.length; i++) this.ccTransforms[i].stateUuid != stateUuid && transforms.push(this.ccTransforms[i]);
              for (var _i2 = 0; _i2 < value.length; _i2++) {
                var item = value[_i2];
                var trans = new CCTransform();
                trans.nodeUuid = item.nodeUuid;
                trans.guid = item.guid;
                trans.stateUuid = item.stateUuid;
                trans.active = item.active;
                trans.position = item.position;
                trans.rotation = item.rotation;
                trans.scale = item.scale;
                trans.anchor = item.anchor;
                trans.size = item.size;
                trans.color = item.color;
                trans.opacity = item.opacity;
                this.targetNodes[_i2].node.getComponent(cc.Sprite) && (trans.spriteFrame = this.targetNodes[_i2].node.getComponent(cc.Sprite).spriteFrame);
                transforms.push(trans);
              }
              this.ccTransforms = transforms;
            }
          }
        },
        onRemoveTarget: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            if (value) {
              var nodes = [];
              for (var i = 0; i < this.targetNodes.length; i++) this.targetNodes[i].guid != value && nodes.push(this.targetNodes[i]);
              this.targetNodes = nodes;
              var transforms = [];
              for (var _i3 = 0; _i3 < this.ccTransforms.length; _i3++) this.ccTransforms[_i3].guid != value && transforms.push(this.ccTransforms[_i3]);
              this.ccTransforms = transforms;
            }
          }
        },
        onAddTarget: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            value ? this._changeTargetByGuid(value[0], value[1]) : cc.error("\u6dfb\u52a0\u76ee\u6807\u503c\u9519\u8bef");
          }
        },
        onChangeTarget: {
          type: cc.Boolean,
          get: function get() {
            return false;
          },
          set: function set(value) {
            value ? this._changeTargetByGuid(value[0], value[1]) : cc.error("\u4fee\u6539\u76ee\u6807\u503c\u9519\u8bef");
          }
        }
      },
      changeStateByIndex: function changeStateByIndex(index) {
        if (this.curState == index) return;
        this.curState = index;
        this._onCurStateChange(index);
      },
      changeStateByName: function changeStateByName(name) {
        for (var i = 0; i < this.switchStates.length; i++) if (name == this.switchStates[i].name) {
          this.changeStateByIndex(i);
          break;
        }
      },
      _onStatesChange: function _onStatesChange() {
        var transforms = [];
        var states = [];
        for (var i = 0; i < this.switchStates.length; i++) states.push(this.switchStates[i].uuid);
        for (var _i4 = 0; _i4 < this.ccTransforms.length; _i4++) states.indexOf(this.ccTransforms[_i4].stateUuid) >= 0 ? transforms.push(this.ccTransforms[_i4]) : cc.log(this.ccTransforms[_i4].stateUuid);
        this.ccTransforms = transforms;
      },
      _onCurStateChange: function _onCurStateChange(index) {
        var curState = this.switchStates[index];
        var transforms = this.ccTransforms;
        for (var i = 0; i < transforms.length; i++) {
          var trans = transforms[i];
          if (trans.stateUuid != curState.uuid) continue;
          var child = this._getNodeByGuid(trans.guid);
          if (child) {
            child.active = trans.active;
            child.position = trans.position;
            child.angle = trans.rotation;
            child.scale = trans.scale;
            child.setAnchorPoint(trans.anchor.x, trans.anchor.y);
            child.setContentSize(trans.size.x, trans.size.y);
            child.color = new cc.Color(trans.color.x, trans.color.y, trans.color.z);
            child.opacity = trans.opacity;
            child.getComponent(cc.Sprite) && trans.spriteFrame && (child.getComponent(cc.Sprite).spriteFrame = trans.spriteFrame);
          } else cc.warn("\u6ca1\u6709\u627e\u5230\u6b64\u8282\u70b9\uff1a" + trans.guid);
        }
      },
      _getNodeByGuid: function _getNodeByGuid(guid) {
        for (var i = 0; i < this.targetNodes.length; i++) if (this.targetNodes[i].guid == guid) return this.targetNodes[i].node;
        return null;
      },
      _changeTargetByGuid: function _changeTargetByGuid(newUuid, guid) {
        this._removeTargetTransByUuid(guid);
        this._changeTargetTransByUuid(newUuid, guid);
      },
      _removeTargetTransByUuid: function _removeTargetTransByUuid(guid) {
        var transforms = [];
        for (var i = 0; i < this.ccTransforms.length; i++) this.ccTransforms[i].guid != guid && transforms.push(this.ccTransforms[i]);
        this.ccTransforms = transforms;
      },
      _changeTargetTransByUuid: function _changeTargetTransByUuid(uuid, guid) {
        var node = this._getNodeByUuid(uuid);
        if (!node || !node && "" != uuid) {
          cc.warn("\u672a\u627e\u5230\u6b64node:" + uuid);
          return;
        }
        var has = false;
        for (var i = 0; i < this.targetNodes.length; i++) if (this.targetNodes[i].guid == guid) {
          this.targetNodes[i].node = node;
          has = true;
        }
        if (!has) {
          var tNode = new TargetNode();
          tNode.guid = guid;
          tNode.node = node;
          this.targetNodes.push(tNode);
        }
        for (var _i5 = 0; _i5 < this.switchStates.length; _i5++) {
          var trans = new CCTransform();
          trans.nodeUuid = uuid;
          trans.guid = guid;
          trans.stateUuid = this.switchStates[_i5].uuid;
          trans.active = node.active;
          trans.position = new cc.Vec2(node.position.x, node.position.y);
          trans.rotation = node.angle;
          trans.color = new cc.Vec3(node.color.r, node.color.g, node.color.b);
          trans.opacity = node.opacity;
          trans.scale = new cc.Vec2(node.scaleX, node.scaleY);
          trans.anchor = new cc.Vec2(node.anchorX, node.anchorY);
          var size = node.getContentSize();
          trans.size = new cc.Vec2(size.width, size.height);
          node.getComponent(cc.Sprite) && (trans.spriteFrame = node.getComponent(cc.Sprite).spriteFrame);
          this.ccTransforms.push(trans);
        }
      },
      _removeStateByUuid: function _removeStateByUuid(uuid) {
        var transforms = [];
        for (var i = 0; i < this.ccTransforms.length; i++) this.ccTransforms[i].stateUuid != uuid && transforms.push(this.ccTransforms[i]);
        this.ccTransforms = transforms;
      },
      _addStateByUuid: function _addStateByUuid(uuid) {
        for (var i = 0; i < this.targetNodes.length; i++) {
          var nodeUuid = this.targetNodes[i].node.uuid;
          var node = this._getNodeByUuid(nodeUuid);
          if (!node) continue;
          var trans = new CCTransform();
          trans.nodeUuid = nodeUuid;
          trans.stateUuid = uuid;
          trans.guid = this.targetNodes[i].guid;
          trans.active = node.active;
          trans.position = new cc.Vec2(node.position.x, node.position.y);
          trans.rotation = node.angle;
          trans.color = new cc.Vec3(node.color.r, node.color.g, node.color.b);
          trans.opacity = node.opacity;
          trans.scale = new cc.Vec2(node.scaleX, node.scaleY);
          trans.anchor = new cc.Vec2(node.anchorX, node.anchorY);
          var size = node.getContentSize();
          trans.size = new cc.Vec2(size.width, size.height);
          node.getComponent(cc.Sprite) && (trans.spriteFrame = node.getComponent(cc.Sprite).spriteFrame);
          this.ccTransforms.push(trans);
        }
      },
      _findNodeFromChildByUuid: function _findNodeFromChildByUuid(uuid, parent) {
        if (parent.uuid == uuid) return parent;
        for (var i = 0; i < parent.childrenCount; i++) {
          var child = parent.children[i];
          var result = this._findNodeFromChildByUuid(uuid, child);
          if (result) return result;
        }
        return null;
      },
      _getNodeByUuid: function _getNodeByUuid(uuid) {
        return cc.engine.getInstanceById(uuid);
        var child;
      }
    });
    cc._RF.pop();
  }, {} ],
  use_reversed_rotateBy: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4b22a/ABrpKML/fRLWYfNuk", "use_reversed_rotateBy");
    "use strict";
    cc.RotateBy._reverse = true;
    cc._RF.pop();
  }, {} ]
}, {}, [ "cloud", "transitions-inspector", "transition-materials", "transitions", "use_reversed_rotateBy", "ProtoMessage", "GameController", "ConstValue", "EventConst", "ViewZOrder", "JsonOb", "StringFormat", "VMBase", "VMBtnGray", "VMCompsEdit", "VMCustom", "VMEvent", "VMLabel", "VMLabelInCode", "VMModify", "VMParent", "VMProgress", "VMState", "ViewModel", "Message", "NetInterface", "NetNode", "ProtoBuf", "ProtoLoader", "Socket", "AutoLoaderCom", "PrefabPool", "ResourceLoader", "SceneUtil", "BackgroundAdapter", "CloseToBorderComponent", "ContentAdapter", "EditWidget", "MultiResoultionCompat", "WXGameTopBarUIAdapter", "BhvButtonGroup", "BhvFrameIndex", "BhvRollNumber", "List", "ListItem", "UIBase", "UIHelp", "Bezier", "BigNumberUtil", "Calculate", "DataUtil", "DragonBoneUtil", "FilledSpriteUtil", "Log", "ExtendRenderFlow", "OptimizaDrawCall", "SingletonFactory", "SpineUtil", "UiUtil", "ui_switcher", "AudioMng", "ConfigMgr", "EventMng", "NetMng", "ScheduleMng", "TcbMng", "UIMng", "WxCloudMng", "AccountModel", "IDataModel", "SystemModel", "CommonButton", "TipsCoolItem", "TipsItem", "UIConfirmDialog", "UITips", "GameDataCenter", "auto_SceneLoadingTip", "auto_LoadingTip", "auto_confirmDialog", "auto_detailTip", "auto_loseTip", "auto_offlinePanel", "auto_tips", "auto_tipsItem", "UILoading", "auto_loading", "GodCommand", "GodGuide", "GodText", "LoadGuide", "async", "locator", "task-02", "task1-01", "SceneLoadingTip", "UIGameOver", "auto_gameOver", "Actor", "AnimSprite", "Background", "Branches", "DrawImage", "GameMng", "Hud", "OImageIds", "Particle", "Utils", "UIPlayerInfo", "auto_playerInfo", "UIResponsibility", "auto_responsibility", "UIDetailTip", "UILoadingTip", "RankItem", "UIWorldRankList", "auto_rankItem", "auto_worldRankList" ]);